aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/ctor8.C11
4 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7048c5f..650e393 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28711
+ * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Robustify.
+
2006-08-17 Paolo Bonzini <bonzini@gnu.org>
PR c++/28573
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 27b6d11..c9e28c8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9201,6 +9201,9 @@ tsubst_copy_and_build (tree t,
tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
bool process_index_p;
+ if (type == error_mark_node)
+ return error_mark_node;
+
/* digest_init will do the wrong thing if we let it. */
if (type && TYPE_PTRMEMFUNC_P (type))
return t;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 624a2f2..6805eb1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28711
+ * g++.dg/template/ctor8.C: New test.
+
2006-08-17 Paolo Bonzini <bonzini@gnu.org>
* PR c++/28573
diff --git a/gcc/testsuite/g++.dg/template/ctor8.C b/gcc/testsuite/g++.dg/template/ctor8.C
new file mode 100644
index 0000000..859bded
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ctor8.C
@@ -0,0 +1,11 @@
+// PR c++/28711
+// { dg-do compile }
+// { dg-options "" }
+
+template<int> struct A
+{
+ int x[1][1];
+ A() : x((int[1][]){{0}}) {} // { dg-error "except the first" }
+};
+
+A<0> a;