[PATCH] D67559: [Sema] Split of versions of -Wimplicit-{float,int}-conversion for Objective-C BOOL

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 10:33:32 PDT 2019


erik.pilkington added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3312
+def warn_impcast_float_to_objc_signed_char_bool : Warning<
+  "implicit conversion from floating-point type %0 to BOOL">,
+  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
----------------
aaron.ballman wrote:
> Can you put single quotes around `BOOL` since it's a type name? Same below.
Sure, this also needs to be fixed for `warn_impcast_constant_value_to_objc_bool` and `warn_tautological_compare_objc_bool`, I'll do that separately. 


================
Comment at: clang/test/SemaObjC/signed-char-bool-conversion.m:3
+// RUN: %clang_cc1 -xobjective-c++ %s -verify -Wobjc-signed-char-bool
+
+typedef signed char BOOL;
----------------
aaron.ballman wrote:
> Can you add a test verifying the fix-it behaviors (with and without parens)?
Sure, while testing this I noticed that we don't handle parens with `OpaqueValueExpr`s properly, so I added a case.


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

https://reviews.llvm.org/D67559





More information about the cfe-commits mailing list