diff options
author | kadir çetinkaya <kadircet@google.com> | 2024-02-23 11:37:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 11:37:30 +0100 |
commit | 5cb2ebc08f6fa42341409b88466c5c266e5839cc (patch) | |
tree | 9ef54cbd070179d6acb5a2968c918951a4bda9c3 /clang-tools-extra | |
parent | 5f1319bb385342c7ef4124b05b83b89ef8588ee8 (diff) | |
download | llvm-5cb2ebc08f6fa42341409b88466c5c266e5839cc.zip llvm-5cb2ebc08f6fa42341409b88466c5c266e5839cc.tar.gz llvm-5cb2ebc08f6fa42341409b88466c5c266e5839cc.tar.bz2 |
Reland "[clang] Preserve found-decl when constructing VarTemplateIds" (#82612)
Update include-cleaner tests. Now that we have proper found-decls set up
for VarTemplates, in case of instationtations we point to primary
templates and not specializations. To be changed in a follow-up patch.
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp b/clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp index bdfc24b..0be5db3 100644 --- a/clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp +++ b/clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp @@ -200,24 +200,24 @@ TEST(WalkAST, VarTemplates) { EXPECT_THAT(testWalk(R"cpp( template <typename T> T $explicit^Foo = 0;)cpp", "int z = ^Foo<int>;"), - ElementsAre(Decl::VarTemplateSpecialization)); + ElementsAre(Decl::VarTemplate)); EXPECT_THAT(testWalk(R"cpp( - template<typename T> T Foo = 0; - template<> int $explicit^Foo<int> = 1;)cpp", + template<typename T> T $explicit^Foo = 0; + template<> int Foo<int> = 1;)cpp", "int x = ^Foo<int>;"), - ElementsAre(Decl::VarTemplateSpecialization)); + ElementsAre(Decl::VarTemplate)); // FIXME: This points at implicit specialization, instead we should point to // explicit partial specializaiton pattern. EXPECT_THAT(testWalk(R"cpp( - template<typename T> T Foo = 0; - template<typename T> T* $explicit^Foo<T*> = nullptr;)cpp", + template<typename T> T $explicit^Foo = 0; + template<typename T> T* Foo<T*> = nullptr;)cpp", "int *x = ^Foo<int *>;"), - ElementsAre(Decl::VarTemplateSpecialization)); + ElementsAre(Decl::VarTemplate)); EXPECT_THAT(testWalk(R"cpp( template<typename T> T $explicit^Foo = 0; template int Foo<int>;)cpp", "int x = ^Foo<int>;"), - ElementsAre(Decl::VarTemplateSpecialization)); + ElementsAre(Decl::VarTemplate)); } TEST(WalkAST, FunctionTemplates) { // Explicit instantiation and (partial) specialization references primary |