]> granicus.if.org Git - clang/commit
[Sema] Enable -Wimplicit-float-conversion for integral to floating point precision...
authorZiang Wan <ziangw2@illinois.edu>
Thu, 1 Aug 2019 00:16:43 +0000 (00:16 +0000)
committerZiang Wan <ziangw2@illinois.edu>
Thu, 1 Aug 2019 00:16:43 +0000 (00:16 +0000)
commitb9aaaa85b7353378aa46432220188efd8f746c9b
tree630f988c450b5d39294daa0a766ef04374f59989
parent77cef9257f5cad3bada4351bf1c22d2b39241495
[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. It is also silenced
when c++11 narrowing warning is issued.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367497 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]
test/Sema/implicit-int-float-narrowing.cpp [new file with mode: 0644]