libstdc++: Fix up to_chars ppc64le _Float128 overloads [PR107636]
Checks
Commit Message
Hi!
As reported, I've misplaced __extension__ keywords in these cases
(wanted not to have them on the whole inlines because _Float128 is
completely standard now while __float128 is not, but before return
it is a syntax error.
I've verified on a short testcase that both g++ and clang++ accept
__extension__ after return keyword.
Bootstrapped/regtested on x86_64-linux and i686-linux (admittedly
not powerpc64le-linux with new glibc), ok for trunk?
2022-11-12 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/107636
* include/std/charconv (to_chars): Fix up powerpc64le _Float128
overload __extension__ placement.
Jakub
Comments
On Sat, 12 Nov 2022, 08:47 Jakub Jelinek via Libstdc++, <
libstdc++@gcc.gnu.org> wrote:
> Hi!
>
> As reported, I've misplaced __extension__ keywords in these cases
> (wanted not to have them on the whole inlines because _Float128 is
> completely standard now while __float128 is not, but before return
> it is a syntax error.
> I've verified on a short testcase that both g++ and clang++ accept
> __extension__ after return keyword.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux (admittedly
> not powerpc64le-linux with new glibc), ok for trunk?
>
OK, thanks
> 2022-11-12 Jakub Jelinek <jakub@redhat.com>
>
> PR libstdc++/107636
> * include/std/charconv (to_chars): Fix up powerpc64le _Float128
> overload __extension__ placement.
>
> --- libstdc++-v3/include/std/charconv.jj 2022-11-11
> 08:15:45.696183293 +0100
> +++ libstdc++-v3/include/std/charconv 2022-11-11 16:32:52.992693605 +0100
> @@ -892,23 +892,25 @@ namespace __detail
> inline to_chars_result
> to_chars(char* __first, char* __last, _Float128 __value) noexcept
> {
> - __extension__
> - return to_chars(__first, __last, static_cast<__float128>(__value));
> + return __extension__ to_chars(__first, __last,
> + static_cast<__float128>(__value));
> }
> inline to_chars_result
> to_chars(char* __first, char* __last, _Float128 __value,
> chars_format __fmt) noexcept
> {
> - __extension__
> - return to_chars(__first, __last, static_cast<__float128>(__value),
> __fmt);
> +
> + return __extension__ to_chars(__first, __last,
> + static_cast<__float128>(__value), __fmt);
> }
> inline to_chars_result
> to_chars(char* __first, char* __last, _Float128 __value,
> chars_format __fmt, int __precision) noexcept
> {
> - __extension__
> - return to_chars(__first, __last, static_cast<__float128>(__value),
> __fmt,
> - __precision);
> +
> + return __extension__ to_chars(__first, __last,
> + static_cast<__float128>(__value), __fmt,
> + __precision);
> }
> #else
> to_chars_result to_chars(char* __first, char* __last, _Float128 __value)
>
> Jakub
>
>
@@ -892,23 +892,25 @@ namespace __detail
inline to_chars_result
to_chars(char* __first, char* __last, _Float128 __value) noexcept
{
- __extension__
- return to_chars(__first, __last, static_cast<__float128>(__value));
+ return __extension__ to_chars(__first, __last,
+ static_cast<__float128>(__value));
}
inline to_chars_result
to_chars(char* __first, char* __last, _Float128 __value,
chars_format __fmt) noexcept
{
- __extension__
- return to_chars(__first, __last, static_cast<__float128>(__value), __fmt);
+
+ return __extension__ to_chars(__first, __last,
+ static_cast<__float128>(__value), __fmt);
}
inline to_chars_result
to_chars(char* __first, char* __last, _Float128 __value,
chars_format __fmt, int __precision) noexcept
{
- __extension__
- return to_chars(__first, __last, static_cast<__float128>(__value), __fmt,
- __precision);
+
+ return __extension__ to_chars(__first, __last,
+ static_cast<__float128>(__value), __fmt,
+ __precision);
}
#else
to_chars_result to_chars(char* __first, char* __last, _Float128 __value)