[include-cleaner] Ignore the ParmVarDecl itself in WalkAST.cpp
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 20 Jun 2023 11:10:45 +0000 (13:10 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 20 Jun 2023 12:26:55 +0000 (14:26 +0200)
commit149f309f50cd981ed320c948f772aa571eaa9afa
tree609d983be08309484b8a58fd71b0e4fcb6b3319d
parent6bea8331f9e09ba94a225c65becd4224a1a473af
[include-cleaner] Ignore the ParmVarDecl itself in WalkAST.cpp

This fixes a false positive where a ParamVarDecl happend to be the
same name of some C standard symbol and has a global namespace.

```
using A = int(int time); // we suggest <ctime> for the `int time`.
```

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