r245811 - Changes missed from r245810

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 23 04:09:41 PDT 2015


Author: sepavloff
Date: Sun Aug 23 06:09:40 2015
New Revision: 245811

URL: http://llvm.org/viewvc/llvm-project?rev=245811&view=rev
Log:
Changes missed from r245810

Modified:
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=245811&r1=245810&r2=245811&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Sun Aug 23 06:09:40 2015
@@ -268,13 +268,13 @@ void Decl::setDeclContextsImpl(DeclConte
 
 bool Decl::isLexicallyWithinFunctionOrMethod() const {
   const DeclContext *LDC = getLexicalDeclContext();
-  do {
+  while (true) {
     if (LDC->isFunctionOrMethod())
       return true;
     if (!isa<TagDecl>(LDC))
       return false;
-    LDC = LDC->getParent();
-  } while (LDC);
+    LDC = LDC->getLexicalParent();
+  }
   return false;
 }
 




More information about the cfe-commits mailing list