gcc/libstdc++-v3/include
Jonathan Wakely 5a4e208022 libstdc++: Ensure that std::from_chars is declared when supported
This adjusts the declarations in <charconv> to match when the definition
is present. This solves the issue that std::from_chars is present on
Solaris 11.3 (using fast_float) but was not declared in the header
(because the declarations were guarded by _GLIBCXX_HAVE_USELOCALE).

Additionally, do not define __cpp_lib_to_chars unless both from_chars
and to_chars are supported (which is only true for IEEE float and
double). We might still provide from_chars (via strtold) but if to_chars
isn't provided, we shouldn't define the feature test macro.

Finally, this simplifies some of the preprocessor checks in the bodies
of std::from_chars in src/c++17/floating_from_chars.cc and hoists the
repeated code for the strtod version into a new function template.

N.B. the long double overload of std::from_chars will always be defined
if the float and double overloads are defined. We can always use one of
strtold or fast_float's binary64 routines (although the latter might
produce errors for some long double values if they are not representable
as binary64).

libstdc++-v3/ChangeLog:

	* include/std/charconv (__cpp_lib_to_chars): Only define when
	both from_chars and to_chars are supported for floating-point
	types.
	(from_chars, to_chars): Adjust preprocessor conditions guarding
	declarations.
	* include/std/version (__cpp_lib_to_chars): Adjust condition to
	match <charconv> definition.
	* src/c++17/floating_from_chars.cc (from_chars_strtod): New
	function template.
	(from_chars): Simplify preprocessor checks and use
	from_chars_strtod when appropriate.
2022-03-16 16:06:29 +00:00
..
backward
bits libstdc++: Move closing brace outside #endif [PR104866] 2022-03-10 21:04:01 +00:00
c
c_compatibility libstdc++: Add atomic_fetch_xor to <stdatomic.h> 2022-02-10 13:01:10 +00:00
c_global libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
c_std libstdc++: Declare std::c8rtomb and std::mbrtoc8 if provided by the C library 2022-01-18 16:31:02 +00:00
debug
decimal
experimental libstdc++: Remove un-implementable noexcept from Filesystem TS operations 2022-02-04 19:51:26 +00:00
ext
parallel
precompiled
pstl
std libstdc++: Ensure that std::from_chars is declared when supported 2022-03-16 16:06:29 +00:00
tr1
tr2
Makefile.am libstdc++: Define <stdatomic.h> for C++23 2022-01-18 16:31:02 +00:00
Makefile.in libstdc++: Define <stdatomic.h> for C++23 2022-01-18 16:31:02 +00:00