Commit a97728cf by Volker Reichelt Committed by Volker Reichelt

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
parent 89b3e3cd
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> 2006-08-17 Paolo Bonzini <bonzini@gnu.org>
PR c++/28573 PR c++/28573
......
...@@ -9201,6 +9201,9 @@ tsubst_copy_and_build (tree t, ...@@ -9201,6 +9201,9 @@ tsubst_copy_and_build (tree t,
tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
bool process_index_p; bool process_index_p;
if (type == error_mark_node)
return error_mark_node;
/* digest_init will do the wrong thing if we let it. */ /* digest_init will do the wrong thing if we let it. */
if (type && TYPE_PTRMEMFUNC_P (type)) if (type && TYPE_PTRMEMFUNC_P (type))
return t; return t;
......
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> 2006-08-17 Paolo Bonzini <bonzini@gnu.org>
* PR c++/28573 * PR c++/28573
// 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment