libstdc++: Avoid implicit narrowing from uint128_t [PR104859]
commit65857caee8ccfac5007a9fd0e5f18cce5e5fe934
authorPatrick Palka <ppalka@redhat.com>
Wed, 9 Mar 2022 23:48:52 +0000 (9 18:48 -0500)
committerPatrick Palka <ppalka@redhat.com>
Wed, 9 Mar 2022 23:48:52 +0000 (9 18:48 -0500)
treee3259ca85879f299cb9b1f8c6d3d202a38c31d13
parent4ea128d5c740e4e8c2e7b70de3a90435035eb863
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.
libstdc++-v3/src/c++17/floating_to_chars.cc