[include-cleaner] Report all specializations if the primary template is introduced...
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 6 Jun 2023 14:09:46 +0000 (16:09 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 7 Jun 2023 08:52:36 +0000 (10:52 +0200)
commit100ffbf991e78bb3e94a9d5c8d656a9b8648082d
tree5d09fffd362bdf69ae33424c579cca3ed04743ba
parent1d153ea9aa0dbb9cc48f7fa882cdd3c65985cc52
[include-cleaner] Report all specializations if the primary template is introduced by a using-decl.

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
}
```

Differential Revision: https://reviews.llvm.org/D152345
clang-tools-extra/include-cleaner/lib/WalkAST.cpp
clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp