summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-07-29 19:59:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-07-29 19:59:45 +0000
commitefb3ef33b67d9e38c2f8d8e6a346e709e6ac83de (patch)
treeec8268eaf8fab488bd15fb9ffb896d4dd97351a3 /lib/Sema/SemaDecl.cpp
parentf43f5a608f52a8481d5e243ce5d1b1258da38fb3 (diff)
downloadclang-efb3ef33b67d9e38c2f8d8e6a346e709e6ac83de.tar.gz
When determining whether a lambda-expression is implicitly constexpr,
check the formal rules rather than seeing if the normal checks produce a diagnostic. This fixes the handling of C++2a extensions in lambdas in C++17 mode, as well as some corner cases in earlier language modes where we issue diagnostics for things other than not satisfying the formal constexpr requirements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 2e82dcf4ac..ced24805ed 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -13532,8 +13532,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
}
if (!IsInstantiation && FD && FD->isConstexpr() && !FD->isInvalidDecl() &&
- (!CheckConstexprFunctionDecl(FD) ||
- !CheckConstexprFunctionBody(FD, Body)))
+ !CheckConstexprFunctionDefinition(FD, CheckConstexprKind::Diagnose))
FD->setInvalidDecl();
if (FD && FD->hasAttr<NakedAttr>()) {