summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-06 04:48:58 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-06 04:48:58 +0000
commitde30785733123f2d69e8a5c4ecad77f8c2b68b7c (patch)
tree17a000352cfec379f1555df11964834e0964b1e8 /gcc/cp/semantics.c
parentee57f0c4986b36d685c983dc0a4f5f22a7787048 (diff)
downloadgcc-de30785733123f2d69e8a5c4ecad77f8c2b68b7c.tar.gz
* semantics.c (finish_compound_literal): Always build a
TARGET_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163893 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 0afa8f994ea..17c795fce08 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2203,20 +2203,7 @@ finish_compound_literal (tree type, tree compound_literal)
if (TREE_CODE (type) == ARRAY_TYPE)
cp_complete_array_type (&type, compound_literal, false);
compound_literal = digest_init (type, compound_literal);
- if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
- && initializer_constant_valid_p (compound_literal, type))
- {
- tree decl = create_temporary_var (type);
- DECL_INITIAL (decl) = compound_literal;
- TREE_STATIC (decl) = 1;
- cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
- decl = pushdecl_top_level (decl);
- DECL_NAME (decl) = make_anon_name ();
- SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
- return decl;
- }
- else
- return get_target_expr (compound_literal);
+ return get_target_expr (compound_literal);
}
/* Return the declaration for the function-name variable indicated by