Set DeclContext of ParamVarDecl only. No need

to set that of VarDecl for block variables
(they are already set). Per Doug's comment.

llvm-svn: 108273
This commit is contained in:
Fariborz Jahanian 2010-07-13 21:05:02 +00:00
parent f0b175328f
commit 714447b2ed
2 changed files with 1 additions and 5 deletions

View File

@ -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;
}

View File

@ -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.