re PR c++/36662 (vector vs template)

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.

	* g++.dg/ext/altivec-16.C: New test.

From-SVN: r137287
This commit is contained in:
Jakub Jelinek 2008-06-30 22:41:29 +02:00 committed by Jakub Jelinek
parent 727683a51c
commit b2febff9b7
4 changed files with 41 additions and 1 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -1,6 +1,7 @@
/* 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.
@ -1005,6 +1006,14 @@ is_late_template_attribute (tree attr, tree decl)
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;

View File

@ -1,3 +1,8 @@
2008-06-30 Jakub Jelinek <jakub@redhat.com>
PR c++/36662
* g++.dg/ext/altivec-16.C: New test.
2008-06-30 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/36648

View File

@ -0,0 +1,19 @@
// 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;
}