From: John McCall Date: Sat, 19 Dec 2009 09:35:56 +0000 (+0000) Subject: Don't use EnterDeclaratorContext when rebuilding a type in the current X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dd7ceb72cc369195d698ccc26c70ac0e56ab945;p=clang Don't use EnterDeclaratorContext when rebuilding a type in the current instantiation, since we're not using a Scope object for that anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91770 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 4b960e81a5..4c2c658571 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1890,9 +1890,12 @@ Sema::HandleDeclarator(Scope *S, Declarator &D, if (DeclContext *DC = computeDeclContext(D.getCXXScopeSpec(), true)) { // FIXME: Preserve type source info. QualType T = GetTypeFromParser(DS.getTypeRep()); - EnterDeclaratorContext(S, DC); + + DeclContext *SavedContext = CurContext; + CurContext = DC; T = RebuildTypeInCurrentInstantiation(T, D.getIdentifierLoc(), Name); - ExitDeclaratorContext(S); + CurContext = SavedContext; + if (T.isNull()) return DeclPtrTy(); DS.UpdateTypeRep(T.getAsOpaquePtr());