diff options
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 65c636b94ea..db5df4db802 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1842,6 +1842,14 @@ static void handleRestrictAttr(Sema &S, Decl *D, const ParsedAttr &AL) { static void handleCPUSpecificAttr(Sema &S, Decl *D, const ParsedAttr &AL) { FunctionDecl *FD = cast<FunctionDecl>(D); + + if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) { + if (MD->getParent()->isLambda()) { + S.Diag(AL.getLoc(), diag::err_attribute_dll_lambda) << AL; + return; + } + } + if (!checkAttributeAtLeastNumArgs(S, AL, 1)) return; |