Stop using "template" when printing qualtype names

Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.

Reviewers: rsmith, rnk

Subscribers: rnk, klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D17214

llvm-svn: 261005
This commit is contained in:
Reid Kleckner 2016-02-16 20:34:27 +00:00
parent b389d9b9af
commit 94f127e84a
2 changed files with 9 additions and 2 deletions

View File

@ -329,7 +329,8 @@ NestedNameSpecifier *createNestedNameSpecifier(
NestedNameSpecifier *createNestedNameSpecifier(
const ASTContext &Ctx, const TypeDecl *TD, bool FullyQualify) {
return NestedNameSpecifier::Create(Ctx, createOuterNNS(Ctx, TD, FullyQualify),
true /*Template*/, TD->getTypeForDecl());
false /*No TemplateKeyword*/,
TD->getTypeForDecl());
}
/// \brief Return the fully qualified type, including fully-qualified

View File

@ -85,7 +85,8 @@ TEST(QualTypeNameTest, getFullyQualifiedName) {
// Namespace alias
Visitor.ExpectedQualTypeNames["CheckL"] = "A::B::C::MyInt";
Visitor.ExpectedQualTypeNames["non_dependent_type_var"] =
"template Foo<X>::non_dependent_type";
"Foo<X>::non_dependent_type";
Visitor.ExpectedQualTypeNames["AnEnumVar"] = "EnumScopeClass::AnEnum";
Visitor.runOver(
"int CheckInt;\n"
"namespace A {\n"
@ -143,6 +144,11 @@ TEST(QualTypeNameTest, getFullyQualifiedName) {
" var.dependent_type_var = 0;\n"
"var.non_dependent_type_var = 0;\n"
"}\n"
"class EnumScopeClass {\n"
"public:\n"
" enum AnEnum { ZERO, ONE };\n"
"};\n"
"EnumScopeClass::AnEnum AnEnumVar;\n"
);
TypeNameVisitor Complex;