saugustine created this revision. saugustine added a reviewer: rsmith. saugustine added subscribers: cfe-commits, klimek.
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. http://reviews.llvm.org/D17214 Files: lib/Tooling/Core/QualTypeNames.cpp unittests/Tooling/QualTypeNamesTest.cpp Index: unittests/Tooling/QualTypeNamesTest.cpp =================================================================== --- unittests/Tooling/QualTypeNamesTest.cpp +++ unittests/Tooling/QualTypeNamesTest.cpp @@ -85,7 +85,8 @@ // 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 @@ " 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; Index: lib/Tooling/Core/QualTypeNames.cpp =================================================================== --- lib/Tooling/Core/QualTypeNames.cpp +++ lib/Tooling/Core/QualTypeNames.cpp @@ -329,7 +329,8 @@ 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
Index: unittests/Tooling/QualTypeNamesTest.cpp =================================================================== --- unittests/Tooling/QualTypeNamesTest.cpp +++ unittests/Tooling/QualTypeNamesTest.cpp @@ -85,7 +85,8 @@ // 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 @@ " 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; Index: lib/Tooling/Core/QualTypeNames.cpp =================================================================== --- lib/Tooling/Core/QualTypeNames.cpp +++ lib/Tooling/Core/QualTypeNames.cpp @@ -329,7 +329,8 @@ 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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits