From 6dc8ae10aa47c59f44339f1e024ee640c72092a8 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 17 Aug 2015 20:24:17 +0000 Subject: [modules] When parsing the base specifiers of a parse-merged class, the current context is the class itself but lookups should be performed starting with the lookup parent of the class (class and base members don't shadow types from the surrounding context because they have not been declared yet). llvm-svn: 245236 --- clang/lib/Sema/SemaDecl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 9282ecad4cb..a8d1e1203e4 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1089,7 +1089,9 @@ Sema::SkippedDefinitionContext Sema::ActOnTagStartSkippedDefinition(Scope *S, auto Result = static_cast(CurContext); CurContext = cast(D)->getDefinition(); assert(CurContext && "skipping definition of undefined tag"); - S->setEntity(CurContext); + // Start lookups from the parent of the current context; we don't want to look + // into the pre-existing complete definition. + S->setEntity(CurContext->getLookupParent()); return Result; } -- cgit v1.2.3