Author: rnk Date: Tue Feb 16 14:34:27 2016 New Revision: 261005 URL: http://llvm.org/viewvc/llvm-project?rev=261005&view=rev Log: 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 Modified: cfe/trunk/lib/Tooling/Core/QualTypeNames.cpp cfe/trunk/unittests/Tooling/QualTypeNamesTest.cpp Modified: cfe/trunk/lib/Tooling/Core/QualTypeNames.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/QualTypeNames.cpp?rev=261005&r1=261004&r2=261005&view=diff ============================================================================== --- cfe/trunk/lib/Tooling/Core/QualTypeNames.cpp (original) +++ cfe/trunk/lib/Tooling/Core/QualTypeNames.cpp Tue Feb 16 14:34:27 2016 @@ -329,7 +329,8 @@ NestedNameSpecifier *createNestedNameSpe 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 Modified: cfe/trunk/unittests/Tooling/QualTypeNamesTest.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/QualTypeNamesTest.cpp?rev=261005&r1=261004&r2=261005&view=diff ============================================================================== --- cfe/trunk/unittests/Tooling/QualTypeNamesTest.cpp (original) +++ cfe/trunk/unittests/Tooling/QualTypeNamesTest.cpp Tue Feb 16 14:34:27 2016 @@ -85,7 +85,8 @@ TEST(QualTypeNameTest, getFullyQualified // 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, getFullyQualified " 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; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits