aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-13 21:05:02 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-13 21:05:02 +0000
commit55a17c057c5293e517609a91438342737ef51545 (patch)
tree733ac792c74d9aaa031c9711e24ae1166dd5dfb0 /lib
parentda65ea86482bc116906edfb9ba1d7124f76cc867 (diff)
Set DeclContext of ParamVarDecl only. No need
to set that of VarDecl for block variables (they are already set). Per Doug's comment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp3
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp3
2 files changed, 1 insertions, 5 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 539b4c409f..0cdc8a12ab 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1068,8 +1068,7 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
CurrentInstantiationScope->InstantiatedLocal(OldParm, NewParm);
// Set DeclContext if inside a Block.
- if (BlockScopeInfo *CurBlock = getCurBlock())
- NewParm->setDeclContext(CurBlock->TheDecl);
+ NewParm->setDeclContext(CurContext);
return NewParm;
}
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b80e824bfd..2fd3528532 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -400,9 +400,6 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Var);
}
InstantiateAttrs(D, Var);
- // Set DeclContext if inside a Block.
- if (BlockScopeInfo *CurBlock = SemaRef.getCurBlock())
- D->setDeclContext(CurBlock->TheDecl);
// Link instantiations of static data members back to the template from
// which they were instantiated.