[PATCH] D63912: [ObjC] Add a warning for implicit conversions of a constant non-boolean value to BOOL
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 8 17:30:41 PDT 2019
rjmccall accepted this revision.
rjmccall added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3251
+ "the only well defined values for BOOL are YES and NO">,
+ InGroup<ConstantConversion>;
----------------
erik.pilkington wrote:
> rjmccall wrote:
> > The `from` seems awkward here; `%0` is the number, not the type. (I agree that the type isn't important for the diagnostic.)
> >
> > Thoughts about this being in a sub-group? I'm not sure either way.
> How about: "implicit conversion from constant value 42 to BOOL; ..."? I guess this is different enough from the other -Wconstant-conversion diagnostics to get a subgroup, so I added one in the new patch.
SGTM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63912/new/
https://reviews.llvm.org/D63912
More information about the cfe-commits
mailing list