Created attachment 19470 [details] sample project to recreate the undesired behavior 'clang-diagnostic-' checks family cannot be the only one enabled for running clang-tidy due to 'no checks enabled' error: $ clang-tidy -checks='-*,clang-diagnostic-unused-variable' main.cpp Error: no checks enabled. Extending check list by any other works fine for 'clang-diagnostic-' also: $ clang-tidy -checks='-*,cert-err34-c,clang-diagnostic-unused-variable' main.cpp 1 error generated. What's worse, 'clang-diagnostic-' checks are not printed by listing all available checks: $ clang-tidy -checks='*' -list-checks | grep clang-diagnostic | wc -l 0 This is really counter-intuitive and makes the user doubt, whether 'clang-diagnostic' checks does still exist. I've tested that on clang-tidy-5.0. There is a sample project attached to easily recreate the issue, with clang-tidy calls prepared.
I can confirm this with clang-tidy-5.0.1. It generates false negatives on files that will not compile: I compile my code with GCC and do static analysis with clang-tidy. Because of varying implementation, GCC may accept code that clang doesn't. In such a case, clang-tidy will print something like: file:line:col: error: ... [clang-diagnostic-error] clang-tidy will then fail to analyse the file but will return a success code. #34930 seems related.