[PATCH] D68137: [clangd] Handle template arguments in findExplicitReferences

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 05:14:23 PDT 2019


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:556
 
+  // We re-define Traverse*, since there's no corresponding Visit*.
+  bool TraverseTemplateArgumentLoc(TemplateArgumentLoc A) {
----------------
... and we need it because, template template decls are visited through it ?


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:567
+      break;
+    case TemplateArgument::Declaration:
+      break; // FIXME: can this actually happen in TemplateArgumentLoc?
----------------
I suppose these corresponds to non-type template paramters, don't they? (which should make it similar to integral case)


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:618
-    if (Ref->NameLoc.isInvalid()) {
-      dlog("invalid location at node {0}", nodeToString(N));
       return;
----------------
can we keep dlog ?


================
Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:751
+            int func();
+            template <int(*)()> struct wrapper {};
+
----------------
can you also name the template param, add a reference in wrapper and check for it ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68137





More information about the cfe-commits mailing list