[clang-tools-extra] [clang-tidy] Improve "-quiet" option by suppressing "xxx warnings generated" (PR #154012)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 17 13:55:45 PDT 2025
vbvictor wrote:
> LGTM, thanks for fixing!
>
> It might be worth double-checking the comment I wrote about this carets option (which I guess is equivalent to passing the command line flag):
>
> [#47042 (comment)](https://github.com/llvm/llvm-project/issues/47042#issuecomment-1305630120)
>
> In particular the fact that part of the diagnostic is removed. But perhaps it's only for compiler warnings and it's not a problem for clang-tidy.
Thanks for the issue link and concerns!
Yes, it doesn't affect `clang-tidy` because there are 2 separate `DiagnosticOptions` we can set in `clang-tidy`.
The first `ClangTidyDiagnosticConsumer` that has one set of `DiagnosticOptions` is left unchanged:
https://github.com/llvm/llvm-project/blob/a10773c8646d482e8747ca37d5a51523505ffbb7/clang-tools-extra/clang-tidy/ClangTidy.cpp#L574-L578
And second one for `CompilerInvocation` that handles `warnings generated` but passes all actual diagnostics to consumer (`clang-tidy` in our case).
I've added tests with carets (hopefully correctly) so this feature will be tracked in the future.
https://github.com/llvm/llvm-project/pull/154012
More information about the cfe-commits
mailing list