From 75d417fd633726cd0f2524f2b3a890a2ec8ba2ac Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 23 Aug 2015 11:09:40 +0000 Subject: [PATCH] Changes missed from r245810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245811 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.50.1