[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 10:12:03 PDT 2017


aaron.ballman added a comment.

In https://reviews.llvm.org/D33672#827513, @xazax.hun wrote:

> Even though it is not undefined behavior in C, it can still cause surprising behavior for the users. I think maybe putting it into the optin package instead of cplusplus is better. What do you think?


I think it's reasonable to diagnose in C when converting the value would lose precision, so long as the check implements that behavior properly for C. That would suggest it belongs somewhere other than cplusplus.


https://reviews.llvm.org/D33672





More information about the cfe-commits mailing list