Commit f4d90295 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/71822 (ICE: in gimplify_expr, at gimplify.c:11025)

	PR c++/71822
	* cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
	fold *expr_p before genericizing it.

	* g++.dg/template/defarg21.C: New test.

From-SVN: r238440
parent f2111a36
2016-07-18 Jakub Jelinek <jakub@redhat.com>
PR c++/71822
* cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
fold *expr_p before genericizing it.
PR c++/71871
* typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
......
......@@ -621,6 +621,8 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
init, VEC_INIT_EXPR_VALUE_INIT (*expr_p),
from_array,
tf_warning_or_error);
hash_set<tree> pset;
cp_walk_tree (expr_p, cp_fold_r, &pset, NULL);
cp_genericize_tree (expr_p);
ret = GS_OK;
input_location = loc;
......
2016-07-18 Jakub Jelinek <jakub@redhat.com>
PR c++/71822
* g++.dg/template/defarg21.C: New test.
PR c++/71871
* g++.dg/ext/vector31.C: New test.
......
// PR c++/71822
// { dg-do compile }
int bar (int);
template <typename T>
struct A
{
explicit A (int x = bar (sizeof (T)));
};
struct B
{
A <int> b[2];
};
void
baz ()
{
B b;
}
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