Commit df794884 by Jason Merrill Committed by Jason Merrill

re PR c++/35708 (jump to label enters catch block)

        PR c++/35708
        * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
        not a pushed variable.

From-SVN: r134146
parent ee8f0bd7
2008-04-09 Jason Merrill <jason@redhat.com>
PR c++/35708
* semantics.c (finish_compound_literal): Return a TARGET_EXPR,
not a pushed variable.
2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
* call.c (build_op_delete_call): Fix quotation in warning message.
......
......@@ -2101,7 +2101,6 @@ finish_unary_op_expr (enum tree_code code, tree expr)
tree
finish_compound_literal (tree type, VEC(constructor_elt,gc) *initializer_list)
{
tree var;
tree compound_literal;
if (!TYPE_OBJ_P (type))
......@@ -2120,30 +2119,12 @@ finish_compound_literal (tree type, VEC(constructor_elt,gc) *initializer_list)
return compound_literal;
}
/* Create a temporary variable to represent the compound literal. */
var = create_temporary_var (type);
if (!current_function_decl)
{
/* If this compound-literal appears outside of a function, then
the corresponding variable has static storage duration, just
like the variable in whose initializer it appears. */
TREE_STATIC (var) = 1;
/* The variable has internal linkage, since there is no need to
reference it from another translation unit. */
TREE_PUBLIC (var) = 0;
/* It must have a name, so that the name mangler can mangle it. */
DECL_NAME (var) = make_anon_name ();
}
/* We must call pushdecl, since the gimplifier complains if the
variable has not been declared via a BIND_EXPR. */
pushdecl (var);
/* Initialize the variable as we would any other variable with a
brace-enclosed initializer. */
cp_finish_decl (var, compound_literal,
/*init_const_expr_p=*/false,
/*asmspec_tree=*/NULL_TREE,
LOOKUP_ONLYCONVERTING);
return var;
type = complete_type (type);
compound_literal = reshape_init (type, compound_literal);
if (TREE_CODE (type) == ARRAY_TYPE)
cp_complete_array_type (&type, compound_literal, false);
compound_literal = digest_init (type, compound_literal);
return get_target_expr (compound_literal);
}
/* Return the declaration for the function-name variable indicated by
......
2008-04-09 Jason Merrill <jason@redhat.com>
PR c++/35708
* g++.dg/ext/complit9.C: New.
2008-04-09 Samuel Tardieu <sam@rfc1149.net>
PR ada/28305
// PR c++/35708
// { dg-options "" }
struct object { int one_o; int allocstamp; };
int pgci_pointable (object obj);
void foo(void);
int main (int argc, char *argv[])
{
if (pgci_pointable((object){7,100}))
{
bad_rehash_size:
foo();
}
goto bad_rehash_size;
}
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