diff options
author | John McCall <rjmccall@apple.com> | 2010-11-12 08:19:04 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-12 08:19:04 +0000 |
commit | 43fed0de4f5bc189e45562491f83d5193eb8dac0 (patch) | |
tree | 72f4386af5ad38d84a5321128c0ea93b2c66ec5e /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 41bafb1b62dfb2577c5aa7ba7fbd6ba5bebdbfee (diff) |
Replace one hack with a different hack: strip out the ObjectType
parameters to the Transform*Type functions and instead call out
the specific cases where an object type and the unqualified lookup
results are important. Fixes an assert and failed compile on
a testcase from PR7248.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 3468a3d93f..c0e0427fe5 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -629,15 +629,13 @@ namespace { NonTypeTemplateParmDecl *D); QualType TransformFunctionProtoType(TypeLocBuilder &TLB, - FunctionProtoTypeLoc TL, - QualType ObjectType); + FunctionProtoTypeLoc TL); ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm); /// \brief Transforms a template type parameter type by performing /// substitution of the corresponding template type argument. QualType TransformTemplateTypeParmType(TypeLocBuilder &TLB, - TemplateTypeParmTypeLoc TL, - QualType ObjectType); + TemplateTypeParmTypeLoc TL); ExprResult TransformCallExpr(CallExpr *CE) { getSema().CallsUndergoingInstantiation.push_back(CE); @@ -869,11 +867,10 @@ ExprResult TemplateInstantiator::TransformCXXDefaultArgExpr( } QualType TemplateInstantiator::TransformFunctionProtoType(TypeLocBuilder &TLB, - FunctionProtoTypeLoc TL, - QualType ObjectType) { + FunctionProtoTypeLoc TL) { // We need a local instantiation scope for this function prototype. LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true); - return inherited::TransformFunctionProtoType(TLB, TL, ObjectType); + return inherited::TransformFunctionProtoType(TLB, TL); } ParmVarDecl * @@ -883,8 +880,7 @@ TemplateInstantiator::TransformFunctionTypeParam(ParmVarDecl *OldParm) { QualType TemplateInstantiator::TransformTemplateTypeParmType(TypeLocBuilder &TLB, - TemplateTypeParmTypeLoc TL, - QualType ObjectType) { + TemplateTypeParmTypeLoc TL) { TemplateTypeParmType *T = TL.getTypePtr(); if (T->getDepth() < TemplateArgs.getNumLevels()) { // Replace the template type parameter with its corresponding @@ -1035,7 +1031,7 @@ TypeSourceInfo *Sema::SubstFunctionDeclType(TypeSourceInfo *T, TypeLoc TL = T->getTypeLoc(); TLB.reserve(TL.getFullDataSize()); - QualType Result = Instantiator.TransformType(TLB, TL, QualType()); + QualType Result = Instantiator.TransformType(TLB, TL); if (Result.isNull()) return 0; |