[PATCH] D148112: [include-cleaner] Improve handling for templates

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 12 08:35:50 PDT 2023


kadircet marked 3 inline comments as done.
kadircet added inline comments.


================
Comment at: clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp:109
     ADD_FAILURE() << DiagBuf << "\nfrom code:\n" << ReferencingCode;
+  llvm::sort(TargetDeclKinds);
+  TargetDeclKinds.erase(llvm::unique(TargetDeclKinds), TargetDeclKinds.end());
----------------
sammccall wrote:
> this seems a little ad-hoc (is class name always enough info, why are we sorting/uniquing here)
> 
> Consider returning vector<NamedDecl*> and using a matcher to verify the things you care about (`kind(Decl::ClassTemplate)` or so?)
sorry was planning to drop this actually, analysistest covers the "we're picking the right declaration at a certain location" logic. but since i forgot, i might as well change it to keep decls around :P


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148112



More information about the cfe-commits mailing list