[PATCH] D152345: [include-cleaner] Report all specializations if the primary template is introduced by a using-decl.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 00:12:47 PDT 2023


hokein created this revision.
hokein added a reviewer: kadircet.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: clang-tools-extra.

This will fix unused-include false positive.

  // primary.h
  namespace ns {
  template<class T1, class T2> class Z {}; // primary template
  }
  
  // partial.h
  namespace ns {
  template<class T> class Z<T, T*> {};     // partial specialization
  }
  
  // main.cpp
  
  using ns::Z; // refs to the primary
  void k() {
    Z<int, int*> z; // use the partial specialization
  }


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152345

Files:
  clang-tools-extra/include-cleaner/lib/WalkAST.cpp
  clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152345.529194.patch
Type: text/x-patch
Size: 4017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230607/830c2e4d/attachment.bin>


More information about the cfe-commits mailing list