Commit 143aa5cc by Paolo Carlini Committed by Paolo Carlini

re PR c++/81055 (ICE with invalid initializer for array new)

/cp
2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81055
	* init.c (build_vec_init): Avoid building an INIT_EXPR with
	error_mark_node as second argument.

/testsuite
2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81055
	* g++.dg/cpp0x/new2.C: New.

From-SVN: r256438
parent 389578d7
2018-01-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81055
* init.c (build_vec_init): Avoid building an INIT_EXPR with
error_mark_node as second argument.
2018-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/83734
......
......@@ -4399,7 +4399,9 @@ build_vec_init (tree base, tree maxindex, tree init,
if (TREE_CODE (init) == TREE_LIST)
init = build_x_compound_expr_from_list (init, ELK_INIT,
complain);
elt_init = build2 (INIT_EXPR, type, to, init);
elt_init = (init == error_mark_node
? error_mark_node
: build2 (INIT_EXPR, type, to, init));
}
}
......
2018-01-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81055
* g++.dg/cpp0x/new2.C: New.
2018-01-10 H.J. Lu <hongjiu.lu@intel.com>
PR target/83735
......
// PR c++/81055
// { dg-do compile { target c++11 } }
int** p = new int*[1]{q}; // { dg-error "not declared" }
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