summaryrefslogtreecommitdiffstats
path: root/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-21 01:08:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-21 01:08:50 +0000
commit840462670ba7a6bc26265a2306b35f2f0f01f51c (patch)
tree83c14a10bce99e57a7064e3edb4a50d3c8b300af /test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
parent39b0e269dc8895ecc0f92f08126d3082b2a837a8 (diff)
The 'constexpr implies const' rule for non-static member functions is gone in
C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp')
-rw-r--r--test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp b/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
index 783aba1823..b9a1bc5288 100644
--- a/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
+++ b/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
@@ -6,8 +6,8 @@ struct S1 {
constexpr S1() = default; // expected-error {{defaulted definition of default constructor is not constexpr}}
constexpr S1(const S1&) = default;
constexpr S1(S1&&) = default;
- constexpr S1 &operator=(const S1&) = default; // expected-error {{explicitly-defaulted copy assignment operator may not have}}
- constexpr S1 &operator=(S1&&) = default; // expected-error {{explicitly-defaulted move assignment operator may not have}}
+ constexpr S1 &operator=(const S1&) const = default; // expected-error {{explicitly-defaulted copy assignment operator may not have}}
+ constexpr S1 &operator=(S1&&) const = default; // expected-error {{explicitly-defaulted move assignment operator may not have}}
constexpr ~S1() = default; // expected-error {{destructor cannot be marked constexpr}}
int n;
};