[PATCH] D59083: [clangd] Store explicit template specializations in index for code navigation purposes

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 03:14:13 PST 2019


gribozavr accepted this revision.
gribozavr added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clangd/CodeComplete.cpp:1513
 
+template <class T> bool explicitTemplateSpecialization(const NamedDecl &ND) {
+  if (const auto *TD = dyn_cast<T>(&ND))
----------------
isExplicitTemplateSpecialization?


================
Comment at: unittests/clangd/SymbolCollectorTests.cpp:395
   Annotations Header(R"(
-    // Template is indexed, specialization and instantiation is not.
-    template <class T> struct [[Tmpl]] {T $xdecl[[x]] = 0;};
-    template <> struct Tmpl<int> {};
-    extern template struct Tmpl<float>;
-    template struct Tmpl<double>;
+    // Template and explicit specialization is indexed, instantiation is not.
+    template <class T, class U> struct [[Tmpl]] {T $xdecl[[x]] = 0;};
----------------
"Template" -> "Primary template"

"is indexed" -> "are indexed"


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59083/new/

https://reviews.llvm.org/D59083





More information about the cfe-commits mailing list