[PATCH] D63912: [ObjC] Add a warning for implicit conversions of a constant non-boolean value to BOOL

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 17:12:53 PDT 2019


erik.pilkington added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3251
+  "the only well defined values for BOOL are YES and NO">,
+  InGroup<ConstantConversion>;
 
----------------
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63912/new/

https://reviews.llvm.org/D63912





More information about the cfe-commits mailing list