]> granicus.if.org Git - clang/commit
[Sema] Enable -Wimplicit-float-conversion for integral to floating point precision...
authorZiang Wan <ziangw2@illinois.edu>
Thu, 25 Jul 2019 00:32:50 +0000 (00:32 +0000)
committerZiang Wan <ziangw2@illinois.edu>
Thu, 25 Jul 2019 00:32:50 +0000 (00:32 +0000)
commit3d2b3adef3c8953fe4b956254054c28fceb439f4
treec65ea25575d4191210e07eabe56b94f1551d3900
parentb452de0d9b4bd0c09d7747b2eaea85a8250dacda
[Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss

Issue an warning when the code tries to do an implicit int -> float
conversion, where the float type ha a narrower significant than the
float type.

The new warning is controlled by flag -Wimplicit-int-float-conversion,
under -Wimplicit-float-conversion and -Wconversion.

Differential Revision: https://reviews.llvm.org/D64666

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366972 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/Sema/conversion.c
test/Sema/ext_vector_casts.c
test/Sema/implicit-int-float-conversion.c [new file with mode: 0644]