diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-21 01:08:50 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-21 01:08:50 +0000 |
commit | 034185c2f9e34c64ef7b3d2703443d7b2f248a81 (patch) | |
tree | 2dccfdc75e6a2bded36e1fafee72cae84ba29e51 /clang/lib/Parse/ParseDecl.cpp | |
parent | 3eab2e43d241994e29233874182b7139af2ed526 (diff) | |
download | bcm5719-llvm-034185c2f9e34c64ef7b3d2703443d7b2f248a81.tar.gz bcm5719-llvm-034185c2f9e34c64ef7b3d2703443d7b2f248a81.zip |
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.
llvm-svn: 179969
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index a39cebccb31..1215e36824d 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5015,7 +5015,8 @@ void Parser::ParseFunctionDeclarator(Declarator &D, Sema::CXXThisScopeRAII ThisScope(Actions, dyn_cast<CXXRecordDecl>(Actions.CurContext), DS.getTypeQualifiers() | - (D.getDeclSpec().isConstexprSpecified() + (D.getDeclSpec().isConstexprSpecified() && + !getLangOpts().CPlusPlus1y ? Qualifiers::Const : 0), IsCXX11MemberFunction); |