This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add tests for template specializations
ClosedPublic

Authored by kadircet on Feb 13 2019, 9:18 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kadircet created this revision.Feb 13 2019, 9:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2019, 9:18 AM
ilya-biryukov added inline comments.Feb 18 2019, 2:48 AM
unittests/clangd/XRefsTests.cpp
376 ↗(On Diff #186685)

While here, could wee add tests for a few more cases? They are all represented by different classes in a hierarchy in clang, so each could potentially break:

/// partial template specialization
template <class T>
struct Foo<T*> {};
^Foo<int*> x;

/// function template specializations
template <class T>
void foo(T);
template <>
void foo(int);

int x = fo^o(10);

/// variable template decls
template <class T>
T var = T();

template <>
double var<int> = 10;

double y = va^r<int>;
kadircet updated this revision to Diff 187213.Feb 18 2019, 3:27 AM
  • Add more testcases
kadircet marked an inline comment as done.Feb 18 2019, 3:27 AM
ilya-biryukov accepted this revision.Feb 18 2019, 5:52 AM

LGTM with a typo-nit :-)

unittests/clangd/XRefsTests.cpp
378 ↗(On Diff #187213)

s/tmeplate/template

This revision is now accepted and ready to land.Feb 18 2019, 5:52 AM
kadircet updated this revision to Diff 187237.Feb 18 2019, 6:21 AM
kadircet marked an inline comment as done.
  • Fix typo and make comments start with 2 slashes
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2019, 6:22 AM