aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-05-17 08:51:48 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-05-17 08:51:48 +0200
commitf23b8501183a7c4645e59d5d6ae9e0e1c0d925d5 (patch)
treecb6a423cab6f20bd29a10111bcc2caa8bdbdb13b /gcc/cp/decl.c
parent7cbd12b88f5749676e888502453056fcc48cd61e (diff)
downloadgcc-f23b8501183a7c4645e59d5d6ae9e0e1c0d925d5.zip
gcc-f23b8501183a7c4645e59d5d6ae9e0e1c0d925d5.tar.gz
gcc-f23b8501183a7c4645e59d5d6ae9e0e1c0d925d5.tar.bz2
re PR c++/21454 (const array doesn't live in the rodata section in C++)
PR c++/21454 * decl.c (maybe_deduce_size_from_array_init): Call cp_apply_type_quals_to_decl after completing array type. * g++.dg/opt/const4.C: New test. From-SVN: r99817
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c110d9f..ac7608b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3939,6 +3939,8 @@ maybe_deduce_size_from_array_init (tree decl, tree init)
if (failure == 3)
error ("zero-size array %qD", decl);
+ cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl);
+
layout_decl (decl, 0);
}
}