+2008-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36662
+ * decl2.c (is_late_template_attribute): If the first attribute
+ argument is IDENTIFIER_NODE, don't consider it when checking
+ if arguments are value or type dependent.
+
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
* ifcvt.c (cond_move_process_if_block): Free vectors on false
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
for (arg = args; arg; arg = TREE_CHAIN (arg))
{
tree t = TREE_VALUE (arg);
+
+ /* If the first attribute argument is an identifier, only consider
+ second and following arguments. Attributes like mode, format,
+ cleanup and several target specific attributes aren't late
+ just because they have an IDENTIFIER_NODE as first argument. */
+ if (arg == args && TREE_CODE (t) == IDENTIFIER_NODE)
+ continue;
+
if (value_dependent_expression_p (t)
|| type_dependent_expression_p (t))
return true;
--- /dev/null
+// PR c++/36662
+// { dg-do compile { target powerpc*-*-* } }
+// { dg-require-effective-target powerpc_altivec_ok }
+// { dg-options "-maltivec" }
+
+#define vector __attribute__((altivec (vector__)))
+
+template <typename c> struct S {};
+
+template <> struct S<vector float>
+{
+ static vector float zero;
+};
+
+template <int>
+void g (void)
+{
+ vector float t = S<vector float>::zero;
+}