[clang-tidy] Disable analysis for broken TU by default
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Currently, clang-tidy will still run check even with `clang-diagnostic-error`'s.
This error means that TU doesn't have complete AST (some part can be missing or some nodes are converted to `RecoveryExpr`).
I propose we should disable analysis for TU that have broken AST because it may:
1. crash clang-tidy
2. provide misleading diagnostics from checks
In our docs we already state that we don't really support analysis with `clang-diagnostic-errors`:
> Clang compiler errors (such as syntax errors, semantic errors, or other failures that prevent Clang from compiling the code) are reported with the check name clang-diagnostic-error. These represent fundamental compilation failures that must be fixed before clang-tidy can perform its analysis. Unlike other diagnostics, clang-diagnostic-error cannot be disabled, as clang-tidy requires valid code to function.
Main part: "clang-tidy requires valid code to function"
We can have a new flag to allow analysis on broken TU for backward-comparability.
Contributor guide
Assessment
This issue has not been assessed yet.