-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
Steps to Reproduce:
With the attached .clang-tidy (a simplified version of our naïve attempt to disable all checkers in a subdirectory we didn’t own), try the following:
clang-tidy --verify-config simple.c
clang-tidy simple.c
Expected Results
Preferably, the simple clang-tidy invocation would return success. Failing that, the --verify-config invocation should warn that the configuration was unacceptable.
Actual Results
clang-tidy --verify-config simple.c
No config errors detected.
clang-tidy simple.c
Error: no checks enabled.
…
echo $?
1
Workaround
Enable an irrelevant checker; see the attached SuperCall.clang-tidy:
clang-tidy --config-file=SuperCall.clang-tidy simple.c
echo $?
0
Limitation
Explicitly disabling clang-diagnostic-error does not work. Uncomment the bogus inclusion in simple.c:
clang-tidy --config-file=Suppress_clang-diagnostic-error.clang-tidy simple.c
1 error generated.
Error while processing /Users/flash/Documents/Bugs/Bug_files/Tidy_Bugs/simple.c.
/Users/flash/Documents/Bugs/Bug_files/Tidy_Bugs/simple.c:1:10: error: 'WarpDarkMatter.h' file not found [clang-diagnostic-error]
1 | #include "WarpDarkMatter.h"
| ^~~~~~~~~~~~~~~~~~
Found compiler error(s).
echo $?
1
This is a severe problem for us, since some parts of the CMake process for lld work fine for actually building our fork, but cause inclusion problems in unittests (which we don’t own) when running clang-tidy (which we’re still investigating).
Related:
- clang-tidy fails to parse config files silently, even with --verify-config. #77341
- clang-diagnostic checker is active even though turned off in config #85777
Configuration
MacOS 13.6.5 22G621 on M1 Max
clang-tidy built in clang version 19.0.0git ([email protected]:llvm/llvm-project.git 6b1cf00
MacOSX14.2.sdk
Xcode 15.2 15C500b, Apple clang-1500.1.0.2.5
Files:
- .clang-tidy:
---
Checks: >
-clang-analyzer-apiModeling.Errno,
-*,
- simple.c
- CMakeLists.txt:
- compile_commands.json
- SuperCall.clang-tidy
- Suppress_clang-diagnostic-error.clang-tidy