From: Serge Pavlov Date: Sun, 23 Aug 2015 11:09:40 +0000 (+0000) Subject: Changes missed from r245810 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75d417fd633726cd0f2524f2b3a890a2ec8ba2ac;p=clang Changes missed from r245810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245811 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 00d7d323b7..c34126ee18 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -268,13 +268,13 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC, bool Decl::isLexicallyWithinFunctionOrMethod() const { const DeclContext *LDC = getLexicalDeclContext(); - do { + while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; - LDC = LDC->getParent(); - } while (LDC); + LDC = LDC->getLexicalParent(); + } return false; }