Commit 14a3430e by Jason Merrill Committed by Jason Merrill

re PR c++/50866 (ICE in verify_gimple_stmt, at tree-cfg.c:4175)

	PR c++/50866
	PR c++/41449
	* semantics.c (maybe_cleanup_point_expr_void): No longer static.
	* typeck2.c (split_nonconstant_init_1): Use it.
	* cp-tree.h: Declare it.
	* decl.c (wrap_cleanups_r): Stop at CLEANUP_POINT_EXPR.

From-SVN: r180442
parent 0c59fd2f
2011-10-25 Jason Merrill <jason@redhat.com>
PR c++/50866
PR c++/41449
* semantics.c (maybe_cleanup_point_expr_void): No longer static.
* typeck2.c (split_nonconstant_init_1): Use it.
* cp-tree.h: Declare it.
* decl.c (wrap_cleanups_r): Stop at CLEANUP_POINT_EXPR.
PR c++/49996
* tree.c (stabilize_init): Stabilize scalar elements of a
CONSTRUCTOR, too.
......
......@@ -5372,6 +5372,7 @@ extern int stmts_are_full_exprs_p (void);
extern void init_cp_semantics (void);
extern tree do_poplevel (tree);
extern void add_decl_expr (tree);
extern tree maybe_cleanup_point_expr_void (tree);
extern tree finish_expr_stmt (tree);
extern tree begin_if_stmt (void);
extern void finish_if_stmt_cond (tree, tree);
......
......@@ -5718,7 +5718,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
static tree
wrap_cleanups_r (tree *stmt_p, int *walk_subtrees, void *data)
{
if (TYPE_P (*stmt_p))
/* Stop at types or full-expression boundaries. */
if (TYPE_P (*stmt_p)
|| TREE_CODE (*stmt_p) == CLEANUP_POINT_EXPR)
{
*walk_subtrees = 0;
return NULL_TREE;
......
......@@ -424,7 +424,7 @@ maybe_cleanup_point_expr (tree expr)
expression. The reason why we do this is because the original type might be
an aggregate and we cannot create a temporary variable for that type. */
static tree
tree
maybe_cleanup_point_expr_void (tree expr)
{
if (!processing_template_decl && stmts_are_full_exprs_p ())
......
......@@ -573,6 +573,7 @@ split_nonconstant_init_1 (tree dest, tree init)
code = build2 (INIT_EXPR, inner_type, sub, value);
code = build_stmt (input_location, EXPR_STMT, code);
code = maybe_cleanup_point_expr_void (code);
add_stmt (code);
if (!TYPE_HAS_TRIVIAL_DESTRUCTOR (inner_type))
{
......
2011-10-25 Jason Merrill <jason@redhat.com>
PR c++/50866
* g++.dg/init/aggr7.C: New.
PR c++/49996
* g++.dg/cpp0x/initlist59.C: New.
......
// PR c++/50866
struct A { A(); ~A(); };
struct B { B(const char *, const A& = A()); ~B(); };
struct C {
B b1, b2;
};
void f()
{
C c = {
"a","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