[PATCH] D155614: [clangd] Make an include always refer to itself. Background: clang-review expects all referents to have definition, declaration or reference(s).

Utkarsh Saxena via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 12:10:28 PDT 2023


usaxena95 added inline comments.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1361-1362
       });
-  if (Results.References.empty())
-    return std::nullopt;
-
----------------
Sorry for the confusion. This looks intentional and somewhat valuable for unused headers. We could fix this on clang-review's end as discussed on the internal patch. We should also add a comment here explaining the rationale behind returning no refs in such cases.

(The check below certainly looks redundant though and could be removed).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155614



More information about the cfe-commits mailing list