diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-08-17 08:02:39 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-08-17 08:02:39 +0000 |
commit | a97728cfa9eb7aa797ddf6dd766900d1a87b2640 (patch) | |
tree | 50a760602ec74ce61ae6b0c1023353fbce460bef | |
parent | 89b3e3cda19cfd551d082dcef6d34b21fb56aeb9 (diff) | |
download | gcc-a97728cfa9eb7aa797ddf6dd766900d1a87b2640.zip gcc-a97728cfa9eb7aa797ddf6dd766900d1a87b2640.tar.gz gcc-a97728cfa9eb7aa797ddf6dd766900d1a87b2640.tar.bz2 |
re PR c++/28711 (ICE on invalid initializer for multidimensional array)
PR c++/28711
* pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Robustify.
* g++.dg/template/ctor8.C: New test.
From-SVN: r116210
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ctor8.C | 11 |
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; |