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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to