diff options
author | Reid Kleckner <rnk@google.com> | 2016-02-16 20:34:27 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-02-16 20:34:27 +0000 |
commit | 94f127e84a871c490db37f382e225508542a1dc1 (patch) | |
tree | 16e352a088334d3f62810aa6e98f7fa5d0db24b3 /clang | |
parent | b389d9b9af204a5891a0e1c4f077ca8fca231890 (diff) | |
download | bcm5719-llvm-94f127e84a871c490db37f382e225508542a1dc1.tar.gz bcm5719-llvm-94f127e84a871c490db37f382e225508542a1dc1.zip |
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
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Tooling/Core/QualTypeNames.cpp | 3 | ||||
-rw-r--r-- | clang/unittests/Tooling/QualTypeNamesTest.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Tooling/Core/QualTypeNames.cpp b/clang/lib/Tooling/Core/QualTypeNames.cpp index 2ff6bad4064..02773be2a18 100644 --- a/clang/lib/Tooling/Core/QualTypeNames.cpp +++ b/clang/lib/Tooling/Core/QualTypeNames.cpp @@ -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 diff --git a/clang/unittests/Tooling/QualTypeNamesTest.cpp b/clang/unittests/Tooling/QualTypeNamesTest.cpp index 889c5252319..d7e7de52e88 100644 --- a/clang/unittests/Tooling/QualTypeNamesTest.cpp +++ b/clang/unittests/Tooling/QualTypeNamesTest.cpp @@ -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; |