[PATCH] D58190: [clangd] Add tests for template specializations
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 13 09:18:09 PST 2019
kadircet created this revision.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov.
Herald added a project: clang.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D58190
Files:
unittests/clangd/XRefsTests.cpp
Index: unittests/clangd/XRefsTests.cpp
===================================================================
--- unittests/clangd/XRefsTests.cpp
+++ unittests/clangd/XRefsTests.cpp
@@ -350,6 +350,30 @@
FF();
void f() { T^est a; }
)cpp",
+
+ R"cpp(
+ template <typename T>
+ struct Foo { void bar() {} };
+
+ template <>
+ struct [[Foo]]<int> { void bar() {} };
+
+ void foo() {
+ Foo<char> abc;
+ Fo^o<int> b;
+ }
+ )cpp",
+
+ R"cpp(
+ template <typename T>
+ struct [[Foo]] { void bar() {} };
+ template <>
+ struct Foo<int> { void bar() {} };
+ void foo() {
+ Fo^o<char> abc;
+ Foo<int> b;
+ }
+ )cpp",
};
for (const char *Test : Tests) {
Annotations T(Test);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58190.186685.patch
Type: text/x-patch
Size: 838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190213/5e753dfe/attachment.bin>
More information about the cfe-commits
mailing list