diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-08 10:24:14 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-08 10:24:14 -0400 |
commit | 329af3c7e9317952d68d3522e9e3aa6ac188332a (patch) | |
tree | 75549a817713216b259210ff71bebd09b571d835 /gcc/cp | |
parent | b862187a34f58510107b5e77917774518ee95b69 (diff) | |
download | gcc-329af3c7e9317952d68d3522e9e3aa6ac188332a.zip gcc-329af3c7e9317952d68d3522e9e3aa6ac188332a.tar.gz gcc-329af3c7e9317952d68d3522e9e3aa6ac188332a.tar.bz2 |
re PR c++/49673 ([C++0x] const variables initialised with constexpr constructor placed in .data not .rodata)
PR c++/49673
gcc/c-family/
* c-common.c (c_apply_type_quals_to_decl): Don't check
TYPE_NEEDS_CONSTRUCTING.
gcc/cp/
* typeck.c (cp_apply_type_quals_to_decl): Don't check
TYPE_NEEDS_CONSTRUCTING.
From-SVN: r176045
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b926ec9..469e6cb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-07-08 Jason Merrill <jason@redhat.com> + + PR c++/49673 + * typeck.c (cp_apply_type_quals_to_decl): Don't check + TYPE_NEEDS_CONSTRUCTING. + 2011-07-07 Jason Merrill <jason@redhat.com> PR c++/49663 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 2acb18e..f0d68c3 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -8127,12 +8127,12 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl) && type_quals != TYPE_UNQUALIFIED)); /* Avoid setting TREE_READONLY incorrectly. */ - if (/* If the object has a constructor, the constructor may modify - the object. */ - TYPE_NEEDS_CONSTRUCTING (type) - /* If the type isn't complete, we don't know yet if it will need + /* We used to check TYPE_NEEDS_CONSTRUCTING here, but now a constexpr + constructor can produce constant init, so rely on cp_finish_decl to + clear TREE_READONLY if the variable has non-constant init. */ + if (/* If the type isn't complete, we don't know yet if it will need constructing. */ - || !COMPLETE_TYPE_P (type) + !COMPLETE_TYPE_P (type) /* If the type has a mutable component, that component might be modified. */ || TYPE_HAS_MUTABLE_P (type)) |