Skip to content
Commit 14aaf445 authored by Fangrui Song's avatar Fangrui Song
Browse files

[Sema] Split off warn_impcast_integer_float_precision_constant into...

[Sema] Split off warn_impcast_integer_float_precision_constant into -Wimplicit-const-int-float-conversion

Currently, both `warn_impcast_integer_float_precision_constant` and
`warn_impcast_integer_float_precision` are covered by
-Wimplicit-int-float-conversion, but only the ..._constant warning is on
by default.

`warn_impcast_integer_float_precision_constant` likely flags real problems
while `warn_impcast_integer_float_precision` may flag legitimate use
cases (for example, `int` used with limited range supported by `float`).

If -Wno-implicit-int-float-conversion is used, currently there is no way
to restore the ..._constant warning. This patch adds
-Wimplicit-const-int-float-conversion to address the issue. (Similar to
the reasoning in https://reviews.llvm.org/D64666#1598194)

Adapted from a patch by Brooks Moses.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D78661
parent 2f9d1533
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment