ArcsinX added a comment. Anyway if this is the only concern, we can handle namespace declaration as a special case inside `ReferencedLocationCrawler::add()`. something like this:
diff - for (const Decl *Redecl : D->redecls()) - Result.User.insert(Redecl->getLocation()); + if (llvm::isa<NamespaceDecl>(D)) { + Result.User.insert(D->getCanonicalDecl()->getLocation()); + } else { + for (const Decl *Redecl : D->redecls()) + Result.User.insert(Redecl->getLocation()); + } And in the above example `#include bar.h` will be suggested to remove Could this be a suitable solution? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134379/new/ https://reviews.llvm.org/D134379 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits