[clang-tidy] Don't emit misc-unused-using-decl warnings for header files.
authorHaojian Wu <hokein.wu@gmail.com>
Mon, 2 Jan 2023 11:04:49 +0000 (12:04 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 4 Jan 2023 09:07:28 +0000 (10:07 +0100)
commit0e11d65a58da32311b562ecea2b5ba9d4d655659
treedfd455efa2fbde4c7640487db1e7bc2cc3893a9e
parent50a1c9b1073d7842ef687e486dc842ffea39457c
[clang-tidy] Don't emit misc-unused-using-decl warnings for header files.

Using decls in header files are special, usually as part of the
public API, the check should not emit warnings on these.

The check already detects unused using-decls which are in the current main
file, but if the main file happens to be a header file, we still
emit warnings, this patch suppresses that.

Differential Revision: https://reviews.llvm.org/D140894
clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h
clang-tools-extra/docs/clang-tidy/checks/misc/unused-using-decls.rst
clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls.hxx [new file with mode: 0644]