From: Alexandre Oliva Date: Fri, 6 May 2022 10:26:04 +0000 (-0300) Subject: [PR105324] libstdc++: testsuite: pr105324 requires FP from_char X-Git-Tag: releases/gcc-12.2.0~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8cd7d0066e0ba2a082b0e7de35e883837546583;p=thirdparty%2Fgcc.git [PR105324] libstdc++: testsuite: pr105324 requires FP from_char The floating-point overloads of from_char are only declared if _GLIBCXX_HAVE_USELOCALE is #defined as nonzero. That's exposed from charconv as __cpp_lib_to_chars >= 201611L, so guard the test body with that. for libstdc++-v3/ChangeLog PR c++/105324 * testsuite/20_util/from_chars/pr105324.cc: Guard test body with conditional for floating-point overloads of from_char. (cherry picked from commit 25389f3de489c25a6983db96428a6bf06aedc829) --- diff --git a/libstdc++-v3/testsuite/20_util/from_chars/pr105324.cc b/libstdc++-v3/testsuite/20_util/from_chars/pr105324.cc index cecb17e41cc6..ef24b4c5c7b7 100644 --- a/libstdc++-v3/testsuite/20_util/from_chars/pr105324.cc +++ b/libstdc++-v3/testsuite/20_util/from_chars/pr105324.cc @@ -5,10 +5,12 @@ int main() { +#if __cpp_lib_to_chars >= 201611L // FP from_char not available otherwise. // PR libstdc++/105324 // std::from_chars() assertion at floating_from_chars.cc:78 std::string s(512, '1'); s[1] = '.'; long double d; std::from_chars(s.data(), s.data() + s.size(), d); +#endif }