forked from OSchip/llvm-project
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:
parent
f0b175328f
commit
714447b2ed
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue