summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/arg5.C9
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index de0dfd425f1..35e0f9fdfe1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8ade0a095c5..84ff4219ee3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7d2b3235c1d..28c386f06d7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.dg/template/arg5.C b/gcc/testsuite/g++.dg/template/arg5.C
new file mode 100644
index 00000000000..3d67143b12d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/arg5.C
@@ -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" }
+}
OpenPOWER on IntegriCloud