re PR c++/30534 (ICE with invalid template argument)
PR c++/30534 * pt.c (any_template_arguments_need_structural_equality_p): Robustify. * g++.dg/template/arg5.C: New test. From-SVN: r122685
This commit is contained in:
parent
ab53bae286
commit
cc891727f0
4 changed files with 23 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2007-03-08 Volker Reichelt <reichelt@netcologne.de>
|
||||
|
||||
PR c++/30534
|
||||
* pt.c (any_template_arguments_need_structural_equality_p):
|
||||
Robustify.
|
||||
|
||||
2007-03-08 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* decl.c (grokdeclarator): Disable warnings for anonymous
|
||||
|
|
|
@ -13131,7 +13131,9 @@ any_template_arguments_need_structural_equality_p (tree args)
|
|||
for (j = 0; j < TREE_VEC_LENGTH (level); ++j)
|
||||
{
|
||||
tree arg = TREE_VEC_ELT (level, j);
|
||||
if (TREE_CODE (arg) == TEMPLATE_DECL
|
||||
if (error_operand_p (arg))
|
||||
return true;
|
||||
else if (TREE_CODE (arg) == TEMPLATE_DECL
|
||||
|| TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
|
||||
continue;
|
||||
else if (TYPE_P (arg) && TYPE_STRUCTURAL_EQUALITY_P (arg))
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2007-03-08 Volker Reichelt <reichelt@netcologne.de>
|
||||
|
||||
PR c++/30534
|
||||
* g++.dg/template/arg5.C: New test.
|
||||
|
||||
2007-03-07 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* g++.dg/eh/arm-iwmmxt-unwind.C: New test.
|
||||
|
|
9
gcc/testsuite/g++.dg/template/arg5.C
Normal file
9
gcc/testsuite/g++.dg/template/arg5.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
// PR c++/30534
|
||||
// { dg-do compile }
|
||||
|
||||
template<bool> struct A;
|
||||
|
||||
template<int> void foo()
|
||||
{
|
||||
A<__builtin_constant_p(.)> a; // { dg-error "template argument" }
|
||||
}
|
Loading…
Add table
Reference in a new issue