[cfe-commits] r147837 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/Sema/Sema.cpp
Eli Friedman
eli.friedman at gmail.com
Mon Jan 9 19:38:46 PST 2012
Author: efriedma
Date: Mon Jan 9 21:38:46 2012
New Revision: 147837
URL: http://llvm.org/viewvc/llvm-project?rev=147837&view=rev
Log:
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().
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/Sema/Sema.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=147837&r1=147836&r2=147837&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Mon Jan 9 21:38:46 2012
@@ -913,7 +913,7 @@
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; }
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=147837&r1=147836&r2=147837&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Mon Jan 9 21:38:46 2012
@@ -640,7 +640,6 @@
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();
}
More information about the cfe-commits
mailing list