summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-14 15:17:30 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-14 15:17:30 +0000
commit98c209e2fcee1b50470884aa9a0d65ba072b7d02 (patch)
treeb68209d0619d2bb1ccd80959b46646f170406e52 /gcc/cp/semantics.c
parent72c0c58fb67609987a44ef9533943a598583f72c (diff)
downloadgcc-98c209e2fcee1b50470884aa9a0d65ba072b7d02.tar.gz
PR c++/41997
* semantics.c (finish_compound_literal): Use cp_apply_type_quals_to_decl when creating a static variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 985e2c0f464..90a76d9391c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2257,6 +2257,7 @@ finish_compound_literal (tree type, tree compound_literal)
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));