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 | 31f82720d03f34f8af1c59441fc89fbbf3efae14 (patch) | |
| tree | a44691cab997a817f8a3442cf8de5b88928962f8 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
| parent | d41071329d3fd5f08fa33e04a32936dda940a903 (diff) | |
| download | bcm5719-llvm-31f82720d03f34f8af1c59441fc89fbbf3efae14.tar.gz bcm5719-llvm-31f82720d03f34f8af1c59441fc89fbbf3efae14.zip | |
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.
llvm-svn: 118887
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 3468a3d93f6..c0e0427fe53 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/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; |

