[cfe-commits] r108273 - in /cfe/trunk/lib/Sema: SemaTemplateInstantiate.cpp SemaTemplateInstantiateDecl.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Jul 13 14:05:02 PDT 2010
Author: fjahanian
Date: Tue Jul 13 16:05:02 2010
New Revision: 108273
URL: http://llvm.org/viewvc/llvm-project?rev=108273&view=rev
Log:
Set DeclContext of ParamVarDecl only. No need
to set that of VarDecl for block variables
(they are already set). Per Doug's comment.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=108273&r1=108272&r2=108273&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Tue Jul 13 16:05:02 2010
@@ -1068,8 +1068,7 @@
CurrentInstantiationScope->InstantiatedLocal(OldParm, NewParm);
// Set DeclContext if inside a Block.
- if (BlockScopeInfo *CurBlock = getCurBlock())
- NewParm->setDeclContext(CurBlock->TheDecl);
+ NewParm->setDeclContext(CurContext);
return NewParm;
}
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=108273&r1=108272&r2=108273&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Tue Jul 13 16:05:02 2010
@@ -400,9 +400,6 @@
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.
More information about the cfe-commits
mailing list