diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2014-10-09 15:53:54 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2014-10-09 13:53:54 +0000 |
commit | d0ff1cb4d9b1972e0aa9535d77413e12c4e84fa2 (patch) | |
tree | 86be65ec8d99fa07ac9f9ddf60af5bb0015932c7 /gcc/cp | |
parent | 12d3031b2c31ad7c9ec956eba52f8451f7b284aa (diff) | |
download | gcc-d0ff1cb4d9b1972e0aa9535d77413e12c4e84fa2.zip gcc-d0ff1cb4d9b1972e0aa9535d77413e12c4e84fa2.tar.gz gcc-d0ff1cb4d9b1972e0aa9535d77413e12c4e84fa2.tar.bz2 |
decl.c (grokdeclarator): constexpr only implies const in C++11.
2014-10-09 Marc Glisse <marc.glisse@inria.fr>
gcc/cp/
* decl.c (grokdeclarator): constexpr only implies const in C++11.
gcc/testsuite/
* g++.dg/cpp0x/constexpr-52892-1.C: Error on missing const in C++14.
* g++.dg/cpp0x/constexpr-array-ptr7.C: Likewise.
* g++.dg/cpp0x/constexpr-diag1.C: Add const.
* g++.dg/cpp0x/constexpr-diag3.C: Likewise.
* g++.dg/cpp0x/constexpr-ex1.C: Likewise.
* g++.dg/cpp0x/constexpr-ex2.C: Likewise.
* g++.dg/cpp0x/constexpr-ex4.C: Likewise.
* g++.dg/cpp0x/constexpr-initlist.C: Likewise.
* g++.dg/cpp0x/constexpr-ptrmem.C: Likewise.
* g++.dg/cpp0x/constexpr-ptrsub.C: Likewise.
* g++.dg/cpp0x/constexpr-ref4.C: Likewise.
* g++.dg/cpp0x/constexpr-static6.C: Likewise.
From-SVN: r216039
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1f9f412..ed71ec2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2014-10-09 Marc Glisse <marc.glisse@inria.fr> + + * decl.c (grokdeclarator): constexpr only implies const in C++11. + 2014-10-08 Jason Merrill <jason@redhat.com> PR c++/63405 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9c8ecc0..d4adbeb 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10539,7 +10539,8 @@ grokdeclarator (const cp_declarator *declarator, && !NEW_DELETE_OPNAME_P (unqualified_id)) { cp_cv_quals real_quals = memfn_quals; - if (constexpr_p && sfk != sfk_constructor && sfk != sfk_destructor) + if (cxx_dialect < cxx14 && constexpr_p + && sfk != sfk_constructor && sfk != sfk_destructor) real_quals |= TYPE_QUAL_CONST; type = build_memfn_type (type, ctype, real_quals, rqual); } |