]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Avoid implicit narrowing from uint128_t [PR104859]
authorPatrick Palka <ppalka@redhat.com>
Wed, 9 Mar 2022 23:48:52 +0000 (18:48 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 7 Apr 2022 19:32:42 +0000 (15:32 -0400)
commitc859c99a85b8743b2c1edc097c6f6406de337f45
treee70081c8e23643fbb6c01cbf1e051c54b2895763
parent4e47b450b72f082de6fba7a060c3a751954e6c17
libstdc++: Avoid implicit narrowing from uint128_t [PR104859]

We need to be explicit about narrowing conversions from uint128_t since,
on targets that lack __int128, this type is defined as an integer-class
type that is only _explicitly_ convertible to the builtin integer types.
This issue was latent until r12-7563-ge32869a17b788b made the frontend
correctly reject explicit conversion functions during (dependent)
copy-initialization.

PR libstdc++/104859

libstdc++-v3/ChangeLog:

* src/c++17/floating_to_chars.cc (__floating_to_chars_hex):
Be explicit when narrowing the shifted effective_mantissa,
since it may have an integer-class type.

(cherry picked from commit 65857caee8ccfac5007a9fd0e5f18cce5e5fe934)
libstdc++-v3/src/c++17/floating_to_chars.cc