[clang-tools-extra] [include-cleaner] Mark RecordDecls referenced in UsingDecls as explicit (PR #106430)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 01:06:25 PDT 2024


================
@@ -203,7 +203,7 @@ class ASTWalker : public RecursiveASTVisitor<ASTWalker> {
   bool VisitUsingDecl(UsingDecl *UD) {
     for (const auto *Shadow : UD->shadows()) {
       auto *TD = Shadow->getTargetDecl();
-      auto IsUsed = TD->isUsed() || TD->isReferenced();
+      auto IsUsed = TD->isUsed() || TD->isReferenced() || !TD->getAsFunction();
----------------
kadircet wrote:

Well I was actually thinking that `usedness` is still the right concept here, spelling of the type name in the using declaration is enough to trigger that use for records.

I added comments also along those lines, LMK if it still doesn't resonate with you.

https://github.com/llvm/llvm-project/pull/106430


More information about the cfe-commits mailing list