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 | 2957e3ef4990b0d63ebe1b18af52c83407da9c1c (patch) | |
tree | df52aa4ebf7fc8f6d8398f407e24385f88ec6dac /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | c9987fbbfe1b85f5a97ff7e4806dcb4b21be4e55 (diff) | |
download | bcm5719-llvm-2957e3ef4990b0d63ebe1b18af52c83407da9c1c.tar.gz bcm5719-llvm-2957e3ef4990b0d63ebe1b18af52c83407da9c1c.zip |
Change the context correctly when instantiating a static data member definition.
llvm-svn: 125517
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 3475cc142db..14524235d50 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/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(); |