diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-27 06:09:13 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-27 06:09:13 +0000 |
commit | 79b01846cc7d0244155eb6deb27fb56dea70c5ec (patch) | |
tree | 7ac7d3aa381cf7fc41ba0b018b9485b01b8d2a44 /gcc/c-decl.c | |
parent | 1c39ab9d9b1ab08b333a01fa03c43c5344e27721 (diff) | |
download | gcc-79b01846cc7d0244155eb6deb27fb56dea70c5ec.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109075 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 8a27e973da6..4c786b6cdb1 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3601,8 +3601,6 @@ mark_forward_parm_decls (void) TREE_ASM_WRITTEN (b->decl) = 1; } -static GTY(()) int compound_literal_number; - /* Build a COMPOUND_LITERAL_EXPR. TYPE is the type given in the compound literal, which may be an incomplete array type completed by the initializer; INIT is a CONSTRUCTOR that initializes the compound @@ -3652,14 +3650,8 @@ build_compound_literal (tree type, tree init) if (TREE_STATIC (decl)) { - /* This decl needs a name for the assembler output. We also need - a unique suffix to be added to the name. */ - char *name; - - ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal", - compound_literal_number); - compound_literal_number++; - DECL_NAME (decl) = get_identifier (name); + /* This decl needs a name for the assembler output. */ + set_compound_literal_name (decl); DECL_DEFER_OUTPUT (decl) = 1; DECL_COMDAT (decl) = 1; DECL_ARTIFICIAL (decl) = 1; |