[PATCH] D41326: [clang-tidy] Added diagnostics about incorrect usage of NOLINT comment
Anton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 17 01:58:33 PST 2017
xgsa added a comment.
In https://reviews.llvm.org/D41326#957749, @JVApen wrote:
> I'm missing some documentation to understand the corner cases. How does this check behave with suppressed warnings for checks which ain't currently checked. (Using -no-... on a code base or suppressing the warnings via the pragmas)
The check just gathers NOLINT comments and compares them with a list of reported diagnostics for the current configuration. Thus, it will report diagnostics on the NOLINT comments, which are added for the checks, which are disabled in current configuration (e.g. with option -check=-some_check).
Note also that in spite NOLINT for clang warnings now works for clang-tidy, it doesn't work for clang itself, so I wouldn't recommended using something like "// NOLINT(clang-diagnostic-unused-variable)". As you mentioned, pragmas or -no-... options should be used instead. The check doesn't perform any processing of those things.
More information about the cfe-commits