Use Sema's LocInfoType to pass and preserve type source info through the Parser.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79395 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index c9281c9..7b29c94 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -215,7 +215,8 @@
TypeTy *DefaultT) {
TemplateTypeParmDecl *Parm
= cast<TemplateTypeParmDecl>(TypeParam.getAs<Decl>());
- QualType Default = QualType::getFromOpaquePtr(DefaultT);
+ // FIXME: Preserve type source info.
+ QualType Default = GetTypeFromParser(DefaultT);
// C++0x [temp.param]p9:
// A default template-argument may be specified for any kind of
@@ -921,7 +922,8 @@
for (unsigned Arg = 0, Last = TemplateArgsIn.size(); Arg != Last; ++Arg) {
TemplateArgs.push_back(
ArgIsType[Arg]? TemplateArgument(TemplateArgLocs[Arg],
- QualType::getFromOpaquePtr(Args[Arg]))
+ //FIXME: Preserve type source info.
+ Sema::GetTypeFromParser(Args[Arg]))
: TemplateArgument(reinterpret_cast<Expr *>(Args[Arg])));
}
}
@@ -1006,6 +1008,7 @@
// Build the fully-sugared type for this class template
// specialization, which refers back to the class template
// specialization we created or found.
+ //FIXME: Preserve type source info.
return Context.getTemplateSpecializationType(Name, TemplateArgs,
NumTemplateArgs, CanonType);
}
@@ -2969,7 +2972,7 @@
Sema::TypeResult
Sema::ActOnTypenameType(SourceLocation TypenameLoc, const CXXScopeSpec &SS,
SourceLocation TemplateLoc, TypeTy *Ty) {
- QualType T = QualType::getFromOpaquePtr(Ty);
+ QualType T = GetTypeFromParser(Ty);
NestedNameSpecifier *NNS
= static_cast<NestedNameSpecifier *>(SS.getScopeRep());
const TemplateSpecializationType *TemplateId