aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 8fe287cb41..6212449744 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -687,7 +687,8 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
if (R || RedeclarationOnly)
return std::make_pair(true, R);
}
- if (Ctx->getParent() != Ctx->getLexicalParent()) {
+ if (Ctx->getParent() != Ctx->getLexicalParent()
+ || isa<CXXMethodDecl>(Ctx)) {
// It is out of line defined C++ method or struct, we continue
// doing name lookup in parent context. Once we will find namespace
// or translation-unit we save it for possible checking