gcc/libstdc++-v3/include/std
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
..
algorithm
any
array Declare std::array members with attribute const [PR101831]. 2022-02-01 17:21:49 -07:00
atomic libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
barrier
bit
bitset
charconv libstdc++: Ensure that std::from_chars is declared when supported 2022-03-16 16:06:29 +00:00
chrono
codecvt
complex libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
concepts
condition_variable
coroutine libstdc++: Install <coroutine> header for freestanding [PR103726] 2022-01-11 13:28:46 +00:00
deque
execution
filesystem libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
forward_list
fstream
functional libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
future
iomanip libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
ios
iosfwd
iostream
istream
iterator
latch
limits
list
locale
map
memory
memory_resource
mutex libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
numbers
numeric libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
optional
ostream
queue
random
ranges libstdc++: Implement P2415R2 changes to viewable_range / views::all 2022-02-22 09:37:58 -05:00
ratio
regex
scoped_allocator
semaphore
set
shared_mutex
source_location libstdc++: Fix cast in source_location::current() [PR104602] 2022-02-24 23:42:41 +00:00
span
spanstream libstdc++: Fix std::spanstream move assignment [PR104032] 2022-01-23 22:48:33 +00:00
sstream
stack
stacktrace libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
stdexcept
stop_token
streambuf
string
string_view libstdc++: Limit new basic_string(nullptr_t) constructor to C++23 [PR104099] 2022-01-18 20:41:46 +00:00
syncstream
system_error
thread
tuple libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
type_traits libstdc++: Ensure all feature test macros have type long [PR87193] 2022-01-21 16:07:34 +00:00
typeindex
unordered_map
unordered_set
utility
valarray
variant libstdc++: Use __cpp_concepts instead of custom macro [PR103891] 2022-02-14 13:03:31 +00:00
vector
version libstdc++: Ensure that std::from_chars is declared when supported 2022-03-16 16:06:29 +00:00