aaron.ballman added inline comments.

================
Comment at: lib/Sema/SemaChecking.cpp:9432
   if (IsLiteral) {
+    // Conversion of a floating point value to a non-bool integer where the
+    // integral part cannot be represented by the integer type is undefined.
----------------
floating point -> floating-point


================
Comment at: lib/Sema/SemaChecking.cpp:9440-9441
+            diag::warn_impcast_literal_float_to_integer_out_of_range);
+      if (IntegerValue.isUnsigned() &&
+          (IntegerValue.isMaxValue() || IntegerValue.isMinValue()))
+        return DiagnoseImpCast(
----------------
I think you can combine all of the predicates into:
```
if (!IsBool && ((IntegerValue.isSigned() && (...) || (IntegerValue.isUnsigned() 
&& (...))))
  return DiagnoseImpCast(S, E, T, CContext, 
diag::warn_impcast_literal_float_to_integer_out_of_range);
```


Repository:
  rC Clang

https://reviews.llvm.org/D46535



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to