diff options
author | John McCall <rjmccall@apple.com> | 2011-02-14 20:37:25 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-14 20:37:25 +0000 |
commit | f5ba7e089daadcd60b0f6e31d932be8bb6045281 (patch) | |
tree | a2fdfec16874e77a03f209b57297f4a8ea6e0c16 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | b641f08cbee230ce872b37816d241cef081af803 (diff) |
Change the context correctly when instantiating a static data member definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 3475cc142d..14524235d5 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2434,13 +2434,13 @@ void Sema::InstantiateStaticDataMemberDefinition( // Enter the scope of this instantiation. We don't use // PushDeclContext because we don't have a scope. - DeclContext *PreviousContext = CurContext; - CurContext = Var->getDeclContext(); + ContextRAII previousContext(*this, Var->getDeclContext()); VarDecl *OldVar = Var; Var = cast_or_null<VarDecl>(SubstDecl(Def, Var->getDeclContext(), getTemplateInstantiationArgs(Var))); - CurContext = PreviousContext; + + previousContext.pop(); if (Var) { MemberSpecializationInfo *MSInfo = OldVar->getMemberSpecializationInfo(); |