aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-12-27 06:09:13 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-12-27 06:09:13 +0000
commit3b2db49f369d82be920b0614b0edaef405efb8ae (patch)
tree7ac7d3aa381cf7fc41ba0b018b9485b01b8d2a44 /gcc/cp/init.c
parent103a4b39c223d6cded567dbc8aed82455a34aeac (diff)
downloadgcc-3b2db49f369d82be920b0614b0edaef405efb8ae.zip
gcc-3b2db49f369d82be920b0614b0edaef405efb8ae.tar.gz
gcc-3b2db49f369d82be920b0614b0edaef405efb8ae.tar.bz2
PR c++/23171, c++/23172, c++/25417.
* c-decl.c (compound_literal_number): Remove. (build_compound_literal): Use set_compound_literal_name. * c-common.c (compound_literal_number): New variable. (set_compound_literal_name): New function. * c-common.h (set_compound_literal_name): Declare. PR c++/23171, c++/23172, c++/25417. * typeck.c (build_unary_op): Create temporary variables for compound literals whose addresses are taken. * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P. * decl.c (reshape_init_vector): Likewise. (reshape_init): Give it external linkage. (check_initializer): Use COMPOUND_LITERAL_P. (initialize_artificial_var): Allow the initializer to be a CONSTRUCTOR. * call.c (make_temporary_var_for_ref_to_temp): Use create_temporary_var. * cp-tree.h (COMPOUND_LITERAL_P): New macro. (rehape_init): Declare. * typeck2.c (digest_init): Use COMPOUND_LITERAL_P. * semantics.c (finish_compound_literal): Use reshape_init. PR c++/23172 * g++.dg/ext/complit4.C: New test. PR c++/25417 * g++.dg/ext/complit5.C: Likewise. From-SVN: r109075
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 54b8a08..dbdd866 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1271,11 +1271,10 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags)
as TARGET_EXPRs. */
if (init && TREE_CODE (exp) == VAR_DECL
- && TREE_CODE (init) == CONSTRUCTOR
- && TREE_HAS_CONSTRUCTOR (init))
+ && COMPOUND_LITERAL_P (init))
{
/* If store_init_value returns NULL_TREE, the INIT has been
- record in the DECL_INITIAL for EXP. That means there's
+ recorded as the DECL_INITIAL for EXP. That means there's
nothing more we have to do. */
init = store_init_value (exp, init);
if (init)