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/testsuite | |
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/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 360c0aa..9393815 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-08 Jason Merrill <jason@redhat.com> + + PR c++/49673 + * g++.dg/cpp0x/constexpr-rom.C: New. + 2011-07-08 Kirill Yukhin <kirill.yukhin@intel.com> PR middle-end/49519 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C new file mode 100644 index 0000000..e2edb2e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C @@ -0,0 +1,11 @@ +// PR c++/49673: check that test_data goes into .rodata +// { dg-options -std=c++0x } +// { dg-final { scan-assembler "rodata" } } + +struct Data +{ + int i; + constexpr Data(int i = 0) : i(i+1) {} +}; + +extern const Data test_data = { 1 }; |