gcc/libstdc++-v3
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
..
config libstdc++: vxworks: remove stray <iostream> include 2022-03-07 08:44:46 +01:00
doc libstdc++: Deprecate non-standard std::vector<bool>::insert(pos) [PR104559] 2022-02-17 23:44:25 +00:00
include libstdc++: Ensure that std::from_chars is declared when supported 2022-03-16 16:06:29 +00:00
libsupc++ libstdc++: Fix std::strong_order to handle NaN on VAX 2022-03-10 14:25:46 +00:00
po
python libstdc++: Make std::error_code printer more robust 2022-02-17 22:22:14 +00:00
scripts
src libstdc++: Ensure that std::from_chars is declared when supported 2022-03-16 16:06:29 +00:00
testsuite libstdc++: Use non-debug vector in constexpr test [PR104748] 2022-03-03 22:28:48 +00:00
acinclude.m4 libstdc++: Add comment to acinclude.m4 2022-02-08 14:15:38 +00:00
aclocal.m4
ChangeLog Daily bump. 2022-03-15 00:16:49 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
config.h.in libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure.ac
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.