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

Ziang Wan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 15:28:37 PDT 2019


ziangwan added a comment.

In D64666#1612947 <https://reviews.llvm.org/D64666#1612947>, @mgorny wrote:

> This change seems to have broken libc++ tests when run with trunk clang:
>  http://lab.llvm.org:8011/builders/netbsd-amd64/builds/21221/steps/run%20unit%20tests/logs/FAIL%3A%20libc%2B%2B%3A%3Aeval.pass.cpp
>  and more in http://lab.llvm.org:8011/builders/netbsd-amd64/builds/21221


The warning is actually correct here. This implicit integral to float conversion loses precision. Is it the intended behavior of the code? If so, we can simply add an explicit type cast to silence the warning.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64666





More information about the llvm-commits mailing list