[PATCH] D88469: [clangd] Heuristic resolution for dependent type and template names

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 20:23:17 PDT 2020


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:128
 const auto ValueFilter = [](const NamedDecl *D) { return isa<ValueDecl>(D); };
+const auto TypeFilter = [](const NamedDecl *D) { return !isa<ValueDecl>(D); };
 
----------------
hokein wrote:
> why not using `isa<TypeDecl>(D)`?
Heh. When I wrote this, I searched for `TypeDecl` via `workspaceSymbols`, did not see it in the first few results, and concluded that there is no such type.

Now I see it is there, just further down (and below **partial** matches like `CFConstantStringTypeDecl`). Maybe I should file a `workspaceSymbols` bug about this :)


================
Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:743
+        template <typename T>
+        void foo(typename A<T>::[[B]]);
+      )cpp";
----------------
hokein wrote:
> can you try to add a nested struct C in B, and verify `typename A<T>::B::[[C]])` still works?
Thank you for the example; this does not currently work.

Also, `typename A<T>::[[B]]::C` does not work either, because only the leaf type gets a `DependentNameType`.

I will try to get these to work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88469



More information about the cfe-commits mailing list