https://bugs.llvm.org/show_bug.cgi?id=46095

Richard Smith <richard-l...@metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> ---
This was an intentional change. Between Clang 8 and Clang 9, we changed the
range of representable values of floating-point types from [-max, +max] to
[-inf, +inf], so there is no longer any undefined behavior when converting
between floating-point types in Clang.

This is documented at
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks:

"""
-fsanitize=float-cast-overflow: Conversion to, from, or between floating-point
types which would overflow the destination. Because the range of representable
values for all floating-point types supported by Clang is [-inf, +inf], the
only cases detected are conversions from floating point to integer types.
"""

Converting 1e51 from double to float is valid since Clang 9, and produces +inf.
This is working as intended.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to