Commit b98fb363 by Jason Merrill Committed by Jason Merrill

re PR c++/60186 ([c++11] ICE with invalid value in constexpr array initializer)

	PR c++/60186
	* typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.

From-SVN: r208027
parent 3e9e24ab
2014-02-21 Jason Merrill <jason@redhat.com>
PR c++/60186
* typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
PR c++/60187
* parser.c (cp_parser_enum_specifier): Call
check_for_bare_parameter_packs.
......
......@@ -1131,7 +1131,10 @@ massage_init_elt (tree type, tree init, tsubst_flags_t complain)
init = TARGET_EXPR_INITIAL (init);
/* When we defer constant folding within a statement, we may want to
defer this folding as well. */
init = maybe_constant_init (init);
tree t = fold_non_dependent_expr_sfinae (init, complain);
t = maybe_constant_value (t);
if (TREE_CONSTANT (t))
init = t;
return init;
}
......
// PR c++/60186
// { dg-require-effective-target c++11 }
template<typename> void foo(int i)
{
constexpr int a[] = { i }; // { dg-error "" }
}
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