kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/FindSymbols.cpp:200
     auto *ND = llvm::dyn_cast<NamedDecl>(D);
-    if (!ND)
+    if (!ND) {
+      // Traverse children of unnamed contexts, e.g. extern "C".
----------------
this will result in traversal of other declcontexts like block/capturedecls.

i think we should rather change the VisitKind to `{No, Decl, Children}` and 
then make `shouldVisit` return a `VisitKindSet` and take a `Decl*` instead of a 
`NamedDecl`.
Later on we should first check for `LinkageSpecDecl` and return `Children` only 
while keeping the rest of the logic the same (i.e. try to cast to nameddecl and 
return `No` if it fails.
Finally logic in here should also be adjusted accordingly to visit children and 
the decl itself separately.

Do you have other cases apart from extern'd symbols?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84839

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to