[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker
Endre Fülöp via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 22 05:16:24 PDT 2017
gamesh411 updated this revision to Diff 112154.
gamesh411 added a comment.
I have implemented the std::transform. The previous version used std::for_each because the iterator for enum declarations was not a random access iterator, but it turned out that I can solve this problem via std::distance. Thanks for sticking to your opinion on this one, because I could learn something new.
As for the type size checking problem: I have noticed that there is already a generic overflow checker, and that would detect the the 'assigning invalid value to an enum' problem. The only advantage of doing it here is that we could probably give a more specific error diagnostic (then again this could be done in the overflow checker as well). So in my opinion that concern belongs there, and this checker should nevertheless belong in the generic optin package, because of the c-style cast is also checked in it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 21991 bytes
Desc: not available
More information about the cfe-commits