More of N3652: don't add an implicit 'const' to 'constexpr' member functions when checking for overloads in C++1y.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184865 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 29644b4..d4d08b4 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1080,7 +1080,8 @@
// or non-static member function). Add it now, on the assumption that this
// is a redeclaration of OldMethod.
unsigned NewQuals = NewMethod->getTypeQualifiers();
- if (NewMethod->isConstexpr() && !isa<CXXConstructorDecl>(NewMethod))
+ if (!S.getLangOpts().CPlusPlus1y && NewMethod->isConstexpr() &&
+ !isa<CXXConstructorDecl>(NewMethod))
NewQuals |= Qualifiers::Const;
if (OldMethod->getTypeQualifiers() != NewQuals)
return true;