]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix __floating_to_chars_precision for __float128
authorPatrick Palka <ppalka@redhat.com>
Wed, 24 Feb 2021 22:31:04 +0000 (17:31 -0500)
committerPatrick Palka <ppalka@redhat.com>
Wed, 24 Feb 2021 22:31:04 +0000 (17:31 -0500)
The code path in __floating_to_chars_precision for handling long double
by going through printf now also handles __float128, so the condition
that guards this code path needs to get updated accordingly.

libstdc++-v3/ChangeLog:

* src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
Relax the condition that guards the printf code path to accept
F128_type as well as long double.

libstdc++-v3/src/c++17/floating_to_chars.cc

index aea96e08df18c0e3fa97932ed968451ec9fa0e00..f1512017aa3c0d894c0e239cc17fa40885086780 100644 (file)
@@ -1151,7 +1151,7 @@ template<typename T>
 
     // Ryu doesn't support formatting floating-point types larger than double
     // with an explicit precision, so instead we just go through printf.
-    if constexpr (is_same_v<T, long double>)
+    if constexpr (is_same_v<T, long double> || is_same_v<T, F128_type>)
       {
        int effective_precision;
        const char* output_specifier;