forked from OSchip/llvm-project
Per John's comment, it makes sense to ask isLambda on any CXXRecordDecl; make sure that's safe. Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext().
llvm-svn: 147837
This commit is contained in:
parent
7d7850af64
commit
9163e360d6
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue