[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 24 01:29:59 PDT 2025
balazske wrote:
> I wonder if behavior of this check should be an extension to [optin.core.EnumCastOutOfRange](https://clang.llvm.org/docs/analyzer/checkers.html#optin-core-enumcastoutofrange). Sure, we don't have `static_cast` here but it's still considered as "cast out of range"? Maybe it's better to add an option to `EnumCastOutOfRange` like `AnalyzeInitialization` and don't write a whole new check?
This check is implemented as an AST based check that is different from the static analyzer check, even if there is a similarity in the found problems. (It can be possible to add this check as not AST-based static analyzer check but the results would be likely not as exact.) Turning on an option in an existing checker is not much different than turning on another checker.
https://github.com/llvm/llvm-project/pull/136823
More information about the cfe-commits
mailing list