[PATCH] D64666: [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 21:28:31 PDT 2019


MaskRay added a comment.

In D64666#1600445 <https://reviews.llvm.org/D64666#1600445>, @ziangwan wrote:

> Update diff.
>
> 1. Fix 2 failing test cases. I omitted these two. My mistake.
> 2. Fix trailing whitespaces.
>
>   Okay?




  error: constant expression evaluates to 123456789 which cannot be narrowed to type 'float'
  note: insert an explicit cast to silence this issue
  warning: implicit conversion from 'int' to 'float' changes value from 123456789 to 123456792

The third diagnostic `warn_impcast_integer_float_precision_constant` is redundant.


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

https://reviews.llvm.org/D64666





More information about the cfe-commits mailing list