]> granicus.if.org Git - clang/commitdiff
Set DeclContext of ParamVarDecl only. No need
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 13 Jul 2010 21:05:02 +0000 (21:05 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 13 Jul 2010 21:05:02 +0000 (21:05 +0000)
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

lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp

index 539b4c409fdbc20d19437666015f512ff1e09d82..0cdc8a12ab73c6f4c92ec605dcccdaec1ea47d7c 100644 (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;  
 }
index b80e824bfd67f8e6643b6c06b2b47aaa1c762d1c..2fd35285324e635eb57cfc95f73448884cf146a1 100644 (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.