aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-09-25 14:48:26 -0400
committerPatrick Palka <ppalka@redhat.com>2023-09-25 14:48:26 -0400
commitbf3c19903a801063551e43bdc2b8b7ea2f69b781 (patch)
tree2f35908137580ffdaf5a9a45384c78777fba7d50 /gcc
parentc92d330c63ac27db69da9a10056b726f686481c0 (diff)
downloadgcc-bf3c19903a801063551e43bdc2b8b7ea2f69b781.zip
gcc-bf3c19903a801063551e43bdc2b8b7ea2f69b781.tar.gz
gcc-bf3c19903a801063551e43bdc2b8b7ea2f69b781.tar.bz2
libstdc++: Shorten integer std::to/from_chars symbol names
For std::to_chars: The constrained alias __integer_to_chars_result_type seems unnecessary ever since r10-3080-g28f0075742ed58 got rid of the only public overload which used it. Now only non-public overloads are constrained by it (through their return type) and these non-public overloads aren't used in a SFINAE context, so the constraints have no observable effect. So this patch gets rid of this alias, which greatly shortens the symbol names of the affected functions (since the expanded alias is quite large). For std::from_chars: We can't get rid of the corresponding alias because its constrains the public integer std::from_chars overload. But we can avoid having the constraint bloat the mangled name by instead encoding it as a defaulted template parameter. We use the non-type parameter form enable_if_t<..., int> = 0 instead of the type parameter form typename = enable_if_t<...> because the type form can be bypassed by giving an explicit template argument for the type parameter, e.g. 'std::from_chars<int, void>(...)', so the non-type form seems like the more robust choice. In passing, use __is_standard_integer in the constraint. libstdc++-v3/ChangeLog: * include/std/charconv (__detail::__integer_to_chars_result_type): Remove. (__detail::__to_chars_16): Use to_chars_result as return type. (__detail::__to_chars_10): Likewise. (__detail::__to_chars_8): Likewise. (__detail::__to_chars_2): Likewise. (__detail::__to_chars_i): Likewise. (__detail::__integer_from_chars_result_type): Inline the constraint into ... (from_chars): ... here. Use __is_standard_integer in the constraint. Encode constraint as a defaulted non-type template parameter instead of within the return type.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions