diff options
-rw-r--r-- | include/clang/AST/DeclCXX.h | 2 | ||||
-rw-r--r-- | lib/Sema/Sema.cpp | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 17c82ca3ef..983139b7b4 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -913,7 +913,7 @@ public: bool hasDeclaredDestructor() const { return data().DeclaredDestructor; } /// \brief Determine whether this class describes a lambda function object. - bool isLambda() const { return data().IsLambda; } + bool isLambda() const { return hasDefinition() && data().IsLambda; } void setLambda(bool Lambda = true) { data().IsLambda = Lambda; } diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 72073a1038..8d358950f6 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -640,7 +640,6 @@ DeclContext *Sema::getFunctionLevelDeclContext() { if (isa<BlockDecl>(DC) || isa<EnumDecl>(DC)) { DC = DC->getParent(); } else if (isa<CXXMethodDecl>(DC) && - cast<CXXRecordDecl>(DC->getParent())->hasDefinition() && cast<CXXRecordDecl>(DC->getParent())->isLambda()) { DC = DC->getParent()->getParent(); } |