]> granicus.if.org Git - clang/commitdiff
Don't use EnterDeclaratorContext when rebuilding a type in the current
authorJohn McCall <rjmccall@apple.com>
Sat, 19 Dec 2009 09:35:56 +0000 (09:35 +0000)
committerJohn McCall <rjmccall@apple.com>
Sat, 19 Dec 2009 09:35:56 +0000 (09:35 +0000)
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

lib/Sema/SemaDecl.cpp

index 4b960e81a5563314463197012f0222482928601e..4c2c658571c7478f9ff0c2f7039a21b702631d66 100644 (file)
@@ -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());