[PATCH] D140894: [clang-tidy] Don't emit misc-unused-using-decl warnings for header files.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 06:13:57 PST 2023


hokein created this revision.
hokein added a reviewer: ymandel.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: clang-tools-extra.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140894

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140894.485980.patch
Type: text/x-patch
Size: 4579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230103/1887676a/attachment.bin>


More information about the cfe-commits mailing list