Index: clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp +++ clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp @@ -350,6 +350,58 @@ FF(); void f() { T^est a; } )cpp", + + R"cpp(// explicit template specialization + template + struct Foo { void bar() {} }; + + template <> + struct [[Foo]] { void bar() {} }; + + void foo() { + Foo abc; + Fo^o b; + } + )cpp", + + R"cpp(// implicit template specialization + template + struct [[Foo]] { void bar() {} }; + template <> + struct Foo { void bar() {} }; + void foo() { + Fo^o abc; + Foo b; + } + )cpp", + + R"cpp(// partial template specialization + template + struct Foo { void bar() {} }; + template + struct [[Foo]] { void bar() {} }; + ^Foo x; + )cpp", + + R"cpp(// function template specializations + template + void foo(T) {} + template <> + void [[foo]](int) {} + void bar() { + fo^o(10); + } + )cpp", + + R"cpp(// variable template decls + template + T var = T(); + + template <> + double [[var]] = 10; + + double y = va^r; + )cpp", }; for (const char *Test : Tests) { Annotations T(Test);