Commit Graph

12109 Commits

Author SHA1 Message Date
Jonathan Wakely
f04e7e540e libstdc++: Fix typo in ChangeLog-2020 2021-01-13 11:02:13 +00:00
Jonathan Wakely
0db5f48848 libstdc++: Remove <debug/array> from Doxygen config
This header was removed recently, so Doxygen shouldn't try to process
it.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (INPUT): Remove include/debug/array.
2021-01-13 10:29:45 +00:00
GCC Administrator
366f86bd42 Daily bump. 2021-01-11 00:16:17 +00:00
David Edelsohn
4a1d7f7e20 libstdc++: Suppress more vstring testsuite warnings. [PR 98613]
PR c++/57111 - 57111 - Generalize -Wfree-nonheap-object to delete

can create false positive warnings for vstring _S_empty_rep.

This patch prunes the excess false positive warnings from two more
testcases.

libstdc++-v3/ChangeLog:

	PR libstdc++/98613
	* testsuite/ext/vstring/cons/moveable.cc: Suppress false positive
	warning.
	* testsuite/ext/vstring/modifiers/assign/move_assign.cc: Same.
2021-01-10 18:22:51 -05:00
GCC Administrator
bf5cbb9edf Daily bump. 2021-01-09 00:16:22 +00:00
Olivier Hainque
98546324c7 Tweak dg-prune-output regex for out-of-build-tree contexts
libstdc++-v3/

	* testsuite/20_util/bind/ref_neg.cc: Tweak the
	dg-prune-output regex for out-of-build-tree contexts.
2021-01-08 16:23:23 +00:00
GCC Administrator
7d187e4f6f Daily bump. 2021-01-08 00:16:23 +00:00
Thomas Rodgers
b7c3f201be libstdc++: Add support for C++20 barriers
Adds <barrier>

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in: Add new header.
	* include/Makefile.am (std_headers): likewise.
	* include/Makefile.in: Regenerate.
	* include/precompiled/stdc++.h: Add new header.
	* include/std/barrier: New file.
	* include/std/version: Add __cpp_lib_barrier feature test macro.
	* testsuite/30_threads/barrier/1.cc: New test.
	* testsuite/30_threads/barrier/2.cc: Likewise.
	* testsuite/30_threads/barrier/arrive_and_drop.cc: Likewise.
	* testsuite/30_threads/barrier/arrive_and_wait.cc: Likewise.
	* testsuite/30_threads/barrier/arrive.cc: Likewise.
	* testsuite/30_threads/barrier/completion.cc: Likewise.
2021-01-07 12:52:37 -08:00
Patrick Palka
19f3c433cd libstdc++: Fix long double to_chars testcase [PR98384]
The testcase was failing to compile on some targets due to its use of
the non-standard functions nextupl and nextdownl.  This patch makes the
testcase instead use the C99 function nexttowardl in an equivalent way.

libstdc++-v3/ChangeLog:

	PR libstdc++/98384
	* testsuite/20_util/to_chars/long_double.cc: Use nexttowardl
	instead of the non-standard nextupl and nextdownl.
2021-01-07 12:41:14 -05:00
GCC Administrator
651b8a50a6 Daily bump. 2021-01-06 00:16:55 +00:00
Samuel Thibault
f56de3557f Update GNU/Hurd configure support
ChangeLog:

	* libtool.m4: Match gnu* along other GNU systems.
	* libgo/config/libtool.m4: Match gnu* along other GNU systems.
	* libgo/configure: Re-generate.

libffi/
	* configure: Re-generate.

libgomp/
	* configure: Re-generate.

gcc/

	* configure: Re-generate.

libatomic/

	* configure: Re-generate.

libbacktrace/

	* configure: Re-generate.

libcc1/

	* configure: Re-generate.

libgfortran/

	* configure: Re-generate.

libgomp/

	* configure: Re-generate.

libhsail-rt/

	* configure: Re-generate.

libitm/

	* configure: Re-generate.

libobjc/

	* configure: Re-generate.

liboffloadmic/

	* configure: Re-generate.
	* plugin/configure: Re-generate.

libphobos/

	* configure: Re-generate.

libquadmath/

	* configure: Re-generate.

libsanitizer/

	* configure: Re-generate.

libssp/

	* configure: Re-generate.

libstdc++-v3/

	* configure: Re-generate.

libvtv/

	* configure: Re-generate.

lto-plugin/

	* configure: Re-generate.

zlib/

	* configure: Re-generate.
2021-01-05 16:04:14 -07:00
Ed Smith-Rowland
ae1ada95fe Add <source_location> to the precompiled header.
2021-01-05  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* include/precompiled/stdc++.h: Add <source_location> to C++20 section.
2021-01-05 15:50:06 -05:00
Jakub Jelinek
99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
GCC Administrator
b6dd195aac Daily bump. 2021-01-02 00:16:24 +00:00
Jakub Jelinek
618e665a0f Rotate ChangeLog files - step 2 - remove 2020 entries from ChangeLog files.
Can't be committed together with the previous one due to the ChangeLog vs.
other files restrictions.
2021-01-01 17:30:04 +01:00
Jakub Jelinek
6e92696278 Rotate ChangeLog files - part 1 - add ChangeLog-2020.
2021-01-01  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
gcc/ada/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
gcc/cp/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
gcc/d/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
gcc/fortran/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
gcc/testsuite/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
libgfortran/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
libstdc++-v3/
	* ChangeLog-2020: Rotate ChangeLog.  New file.
2021-01-01 17:27:52 +01:00
GCC Administrator
adfe99ad8f Daily bump. 2020-12-28 00:16:28 +00:00
Gerald Pfeifer
15b99a6b83 libstdc++: Update link to Arm ABI
libstdc++-v3:

2020-12-27  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/abi.xml: Update link to Arm ABI.
	* doc/html/manual/abi.html: Regenerate.
2020-12-27 21:25:32 +01:00
Gerald Pfeifer
0e283e2c9f libstdc++: Move Valgrind references to https
libstdc++-v3:

2020-12-27  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/debug.xml: Move Valgrind references to https.
	* doc/html/manual/debug.html: Regenerate.
2020-12-27 11:17:21 +01:00
GCC Administrator
521bc8e1b0 Daily bump. 2020-12-27 00:16:18 +00:00
Gerald Pfeifer
9d426e4dbc libstdc++: Update link to Intel/GNU compatibility paper
libstdc++-v3:

2020-12-26  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/abi.xml: Update link to Intel's compatibility
	with GNU compilers document.
	* doc/html/manual/abi.html: Regenerate.
2020-12-26 13:37:48 +01:00
GCC Administrator
5b4da2d9e1 Daily bump. 2020-12-26 00:16:19 +00:00
Gerald Pfeifer
a746898dff libstdc++: Update link to Java docs
libstdc++-v3:

2020-12-25  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/messages.xml: Update link to Java docs.
	* doc/html/manual/facets.html: Ditto.
2020-12-25 19:14:35 +01:00
Gerald Pfeifer
4ee8e5949a libstdc++: Convert three doxygen.nl links to https
libstdc++-v3:
2020-12-25  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/documentation_hacking.xml: Convert three links
	to doxygen.nl to https.
	* doc/html/manual/documentation_hacking.html: Regenerate.
2020-12-25 15:20:43 +01:00
GCC Administrator
85d8ebcfc2 Daily bump. 2020-12-24 00:16:26 +00:00
Olivier Hainque
eb81c997d8 Account for VxWorks headers in libstdc++ test on names
Undefine various macros unexpectedly defined by VxWorks headers.


for  libstdc++-v3/ChangeLog

	* testsuite/17_intro/names.cc: Account for VxWorks headers.
2020-12-23 20:27:36 -03:00
GCC Administrator
1a5e728a54 Daily bump. 2020-12-22 00:16:23 +00:00
Patrick Palka
6a31d47e27 libstdc++: Disable floating-point std::to_chars on unsupported targets
This patch conditionally disables the floating-point std::to_chars
implementation on targets whose float and double aren't IEEE binary32
and binary64, until a proper fallback can be added for such targets.
This fixes a bootstrap failure on non-IEEE-754 FP targets such as
vax-netbsdelf.

The new preprocessor tests in c++config that detect the binary32 and
binary64 formats were copied from gcc/testsuite/gcc.dg/float-exact-1.c.

libstdc++-v3/ChangeLog:

	* include/bits/c++config (_GLIBCXX_FLOAT_IS_IEEE_BINARY_32):
	Define this macro.
	(_GLIBCXX_DOUBLE_IS_IEEE_BINARY_64): Likewise.
	* include/std/charconv (to_chars): Use these macros to
	conditionally hide the overloads for floating-point types.
	* src/c++17/floating_to_chars.cc: Use the macros to
	conditionally disable this file.
	(floating_type_traits<float>): Remove redundant static assert.
	(floating_type_traits<double>): Likewise.
	* testsuite/20_util/to_chars/double.cc: Run this test only on
	ieee-floats effective targets.
	* testsuite/20_util/to_chars/float.cc: Likewise.
	* testsuite/20_util/to_chars/long_double.cc: Likewise.
	* testsuite/lib/libstdc++.exp
	(check_effective_target_ieee-floats): Define new proc for
	detecting whether float and double have the IEEE binary32 and
	binary64 formats.
2020-12-21 15:15:36 -05:00
GCC Administrator
108beb75da Daily bump. 2020-12-21 00:16:20 +00:00
Jonathan Wakely
3621a7bb57 libstdc++: Fix indentation in <semaphore>
libstdc++-v3/ChangeLog:

	* include/std/semaphore: Fix indentation.
2020-12-20 18:49:46 +00:00
GCC Administrator
b1a2242e24 Daily bump. 2020-12-19 00:16:31 +00:00
Patrick Palka
60cecb2b83 libstdc++: Fix mistake in PR98374 change [PR98377]
The #ifdef RADIXCHAR directive should be moved one line up so that it
also guards the outer if statement, or else when RADIXCHAR is not
defined the outer if statement will end up nonsensically guarding the
declaration of output_length_upper_bound a few lines below it.

libstdc++-v3/ChangeLog:

	PR libstdc++/98377
	* src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
	Fix mistake.
2020-12-18 13:01:49 -05:00
Patrick Palka
22a7e82c20 libstdc++: Fix build failure on AArch64 ILP32 [PR98370]
This should fix a build failure on AArch64 ILP32 due to int32_t mapping
to long int instead of int on this platform, which causes type deduction
to fail in the below call to std::max as reported in the PR.

libstdc++-v3/ChangeLog:

	PR libstdc++/98370
	* src/c++17/floating_to_chars.cc (__floating_to_chars_shortest):
	Provide explicit template arguments to the call to std::max.
2020-12-18 11:52:24 -05:00
Patrick Palka
d7bab388b8 libstdc++: Fix build failure due to missing <langinfo.h> [PR98374]
This should fix a build failure on Windows which lacks <langinfo.h>,
from which we use nl_langinfo() to obtain the radix character of the
current locale.  (We can't use the more portable localeconv() from
<clocale> to obtain the radix character of the current locale here
because it's not thread-safe, unfortunately.)

This change means that on Windows and other such platforms, we'll just
always assume the radix character used by printf is '.' when formatting
a long double through it.

libstdc++-v3/ChangeLog:

	PR libstdc++/98374
	* src/c++17/floating_to_chars.cc: Guard include of <langinfo.h>
	with __has_include.
	(__floating_to_chars_precision) [!defined(RADIXCHAR)]: Don't
	attempt to obtain the radix character of the current locale,
	just assume it's '.'.
2020-12-18 11:52:17 -05:00
Patrick Palka
266d746475 libstdc++: Check FE_TONEAREST is defined before using it
We need to test that FE_TONEAREST is defined before we may use it along
with fegetround/fesetround to adjust the floating-point rounding mode.
This fixes a build failure with older versions of newlib.

libstdc++-v3/ChangeLog:

	* src/c++17/floating_from_chars.cc (from_chars_impl)
	[!defined(FE_TONEAREST)]: Don't adjust the rounding mode.
	* src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
	Likewise.
2020-12-18 11:52:14 -05:00
Patrick Palka
ddb9c661c2 libstdc++: Import MSVC floating-point std::to_chars testcases
The testcases are imported almost verbatim, with the only change being
to the -double_nan and -float_nan testcases.  We expect these values to
be formatted as "-nan" instead of "-nan(ind)".

libstdc++-v3/ChangeLog:

	* testsuite/20_util/to_chars/double.cc: New test, consisting of
	testcases imported from the MSVC STL testsuite.
	* testsuite/20_util/to_chars/float.cc: Likewise.
2020-12-17 23:11:38 -05:00
Patrick Palka
3c57e69235 libstdc++: Add floating-point std::to_chars implementation
This implements the floating-point std::to_chars overloads for float,
double and long double.  We use the Ryu library to compute the shortest
round-trippable fixed and scientific forms for float, double and long
double.  We also use Ryu for performing explicit-precision fixed and
scientific formatting for float and double. For explicit-precision
formatting for long double we fall back to using printf.  Hexadecimal
formatting for float, double and long double is implemented from
scratch.

The supported long double binary formats are binary64, binary80 (x86
80-bit extended precision), binary128 and ibm128.

Much of the complexity of the implementation is in computing the exact
output length before handing it off to Ryu (which doesn't do bounds
checking).  In some cases it's hard to compute the output length
beforehand, so in these cases we instead compute an upper bound on the
output length and use a sufficiently-sized intermediate buffer only if
necessary.

Another source of complexity is in the general-with-precision formatting
mode, where we need to do zero-trimming of the string returned by Ryu,
and where we also take care to avoid having to format the number through
Ryu a second time when the general formatting mode resolves to fixed
(which we determine by doing a scientific formatting first and
inspecting the scientific exponent).  We avoid going through Ryu twice
by instead transforming the scientific form to the corresponding fixed
form via in-place string manipulation.

This implementation is non-conforming in a couple of ways:

1. For the shortest hexadecimal formatting, we currently follow the
   Microsoft implementation's decision to be consistent with the
   output of printf's '%a' specifier at the expense of sometimes not
   printing the shortest representation.  For example, the shortest hex
   form for the number 1.08p+0 is 2.1p-1, but we output the former
   instead of the latter, as does printf.

2. The Ryu routine generic_binary_to_decimal that we use for performing
   shortest formatting for large floating point types is implemented
   using the __int128 type, but some targets with a large long double
   type lack __int128 (e.g. i686), so we can't perform shortest
   formatting of long double on such targets through Ryu.  As a
   temporary stopgap this patch makes the long double to_chars overloads
   just dispatch to the double overloads on these targets, which means
   we lose precision in the output.  (We could potentially fix this by
   writing a specialized version of Ryu's generic_binary_to_decimal
   routine that uses uint64_t instead of __int128.)  [Though I wonder if
   there's a better way to work around the lack of __int128 on i686
   specifically?]

3. Our shortest formatting for __ibm128 doesn't guarantee the round-trip
   property if the difference between the high- and low-order exponent
   is large.  This is because we treat __ibm128 as if it has a
   contiguous 105-bit mantissa by merging the mantissas of the high-
   and low-order parts (using code extracted from glibc), so we
   potentially lose precision from the low-order part.  This seems to be
   consistent with how glibc printf formats __ibm128.

libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu.ver: Add new exports.
	* include/std/charconv (to_chars): Declare the floating-point
	overloads for float, double and long double.
	* src/c++17/Makefile.am (sources): Add floating_to_chars.cc.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++17/floating_to_chars.cc: New file.
	(to_chars): Define for float, double and long double.
	* testsuite/20_util/to_chars/long_double.cc: New test.
2020-12-17 23:11:34 -05:00
Patrick Palka
5033506993 libstdc++: Apply modifications to our local copy of Ryu
This performs the following modifications to our local copy of Ryu in
order to make it more readily usable for our std::to_chars
implementation:

  * Remove all #includes
  * Remove copy_special_str routines
  * Adjust the exponent formatting to match printf
  * Remove some functions we're not going to use
  * Add an out-parameter to d2exp_buffered_n for the scientific exponent
  * Store the sign bit inside struct floating_decimal_[32|64]
  * Rename [df]2s_buffered_n and change their return type
  * Make generic_binary_to_decimal take the bit representation in parts

libstdc++-v3/ChangeLog:

	* src/c++17/ryu/common.h, src/c++17/ryu/d2fixed.c,
	src/c++17/ryu/d2fixed_full_table.h, src/c++17/ryu/d2s.c,
	src/c++17/ryu/d2s_intrinsics.h, src/c++17/ryu/f2s.c,
	src/c++17/ryu/f2s_intrinsics.h, src/c++17/ryu/generic_128.c:
	Apply local modifications.
2020-12-17 23:11:15 -05:00
Patrick Palka
e3f0eaa282 libstdc++: Import parts of the Ryu library
This imports the source files from the Ryu library that define
d2s_buffered_n, f2s_buffered_n, d2fixed_buffered_n, d2exp_buffered_n and
generic_binary_to_decimal, which we're going to use as the base of our
std::to_chars implementation.

libstdc++-v3/ChangeLog:

	* src/c++17/ryu/MERGE: New file.
	* src/c++17/ryu/common.h, src/c++17/ryu/d2fixed.c,
	src/c++17/ryu/d2fixed_full_table.h, src/c++17/ryu/d2s.c,
	src/c++17/ryu/d2s_full_table.h, src/c++17/ryu/d2s_intrinsics.h,
	src/c++17/ryu/digit_table.h, src/c++17/ryu/f2s.c,
	src/c++17/ryu/f2s_intrinsics.h, src/c++17/ryu/generic_128.c,
	src/c++17/ryu/generic_128.h, src/c++17/ryu/ryu_generic_128.h:
	Import these files from the Ryu library.
2020-12-17 23:11:12 -05:00
GCC Administrator
cd69e3d5cd Daily bump. 2020-12-18 00:16:30 +00:00
Jonathan Wakely
217d5beaff libstdc++: Test errno macros directly for all targets [PR 93151]
This applies the same changes to the djgpp and mingw versions of
error_constants.h as r11-6137 did for the generic version.

All of these constants are defined as macros by <errno.h> on these
targets, so we can just test the macro directly instead of checking for
it at configure time.

libstdc++-v3/ChangeLog:

	* config/os/djgpp/error_constants.h: Test POSIX errno macros
	directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
	* config/os/mingw32-w64/error_constants.h: Likewise.
	* config/os/mingw32/error_constants.h: Likewise.
2020-12-17 16:19:20 +00:00
Jonathan Wakely
b2bc1bb6ca libstdc++: Fix condition for gthreads-timed effective-target
The refactoring in r11-5500 altered the condition for the gthreads-timed
test from #if to #ifdef. For some reason that macro is always defined,
rather than being defined to 1 or undefined like most of our autoconf
macros. That means the test always passes now, even for targets where
the macro is defined to 0 (specifically, Darwin). That causes some tests
to FAIL when they should have been UNSUPPORTED.

This restores the previous behaviour.

libstdc++-v3/ChangeLog:

	* testsuite/lib/libstdc++.exp (check_v3_target_gthreads_timed):
	Fix condition for _GTHREAD_USE_MUTEX_TIMEDLOCK test.
2020-12-17 16:16:37 +00:00
Jonathan Wakely
9f9dbc8e09 libstdc++: Fix -Wunused warning
As noted in PR 66146 comment 35, there is a new warning in the new
std::call_once implementation.

libstdc++-v3/ChangeLog:

	* src/c++11/mutex.cc (std::once_flag::_M_finish): Add
	maybe_unused attribute to variable used in assertion.
2020-12-17 14:03:00 +00:00
Jonathan Wakely
8dc63f13f0 libstdc++: Fix preprocessor condition [PR 98344]
libstdc++-v3/ChangeLog:

	PR libstdc++/98344
	* include/bits/semaphore_base.h: Fix preprocessor condition.
2020-12-17 14:03:00 +00:00
Jonathan Wakely
8cdca5f9c7 libstdc++: Move std::hash<std:🧵:id> to <bits/std_thread.h>
This makes the hash function available without including the whole of
<thread>, which is needed for <barrier>.

libstdc++-v3/ChangeLog:

	* include/bits/std_thread.h (hash<thread::id>): Move here,
	from ...
	* include/std/thread (hash<thread::id>): ... here.
2020-12-17 14:03:00 +00:00
Jonathan Wakely
f5feee6adc libstdc++: Regenerate autoconf files
I forgot to regenerate these files in r11-6137.

libstdc++-v3/ChangeLog:

	* config.h.in: Regenerate.
	* configure: Regenerate.
2020-12-17 14:02:59 +00:00
GCC Administrator
eefe499fdf Daily bump. 2020-12-17 00:16:37 +00:00
Jonathan Wakely
7c1e7eed89 libstdc++: Add C++ runtime support for new 128-bit long double format
This adds support for the new __ieee128 long double format on
powerpc64le targets.

Most of the complexity comes from wanting a single libstdc++.so library
that contains the symbols needed by code compiled with both
-mabi=ibmlongdouble and -mabi=ieeelongdouble (and not forgetting
-mlong-double-64 as well!)

In a few places this just requires an extra overload, for example
std::from_chars has to be overloaded for both forms of long double.
That can be done in a single translation unit that defines overloads
for 'long double' and also '__ieee128', so that user code including
<charconv> will be able to link to a definition for either type of long
double. Those are the easy cases.

The difficult parts are (as for the std::string ABI transition) the I/O
and locale facets. In order to be able to write either form of long
double to an ostream such as std::cout we need the locale to contain a
std::num_put facet that can handle both forms. The same approach is
taken as was already done for supporting 64-bit long double and 128-bit
long double: adding extra overloads of do_put to the facet class. On
targets where the new long double code is enabled, the facets that are
registered in the locale at program startup have additional overloads so
that they can work with any long double type. Where this fails to work
is if user code installs its own facet, which will probably not have the
additional overloads and so will only be able to output one or the other
type. In practice the number of users expecting to be able to use their
own locale facets in code using a mix of -mabi=ibmlongdouble and
-mabi=ieeelongdouble is probably close to zero.

libstdc++-v3/ChangeLog:

	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* config/abi/pre/gnu.ver: Make patterns less greedy.
	* config/os/gnu-linux/ldbl-ieee128-extra.ver: New file with patterns
	for IEEE128 long double symbols.
	* configure: Regenerate.
	* configure.ac: Enable alternative 128-bit long double format on
	powerpc64*-*-linux*.
	* doc/Makefile.in: Regenerate.
	* fragment.am: Regenerate.
	* include/Makefile.am: Set _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Define inline namespace for new long
	double symbols. Don't define _GLIBCXX_USE_FLOAT128 when it's the
	same type as long double.
	* include/bits/locale_classes.h [_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT]
	(locale::_Impl::_M_init_extra_ldbl128): Declare new member function.
	* include/bits/locale_facets.h (_GLIBCXX_NUM_FACETS): Simplify by
	only counting narrow character facets.
	(_GLIBCXX_NUM_CXX11_FACETS): Likewise.
	(_GLIBCXX_NUM_LBDL_ALT128_FACETS): New.
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT] (num_get::__do_get): Define
	vtable placeholder for __ibm128 long double type.
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(num_get::__do_get): Declare vtable placeholder for __ibm128 long
	double type.
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(num_put::__do_put): Likewise.
	* include/bits/locale_facets.tcc
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(num_get::__do_get, num_put::__do_put): Define.
	* include/bits/locale_facets_nonio.h
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(money_get::__do_get): Declare vtable placeholder for __ibm128 long
	double type.
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(money_put::__do_put): Likewise.
	* include/bits/locale_facets_nonio.tcc
	[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
	(money_get::__do_get, money_put::__do_put): Define.
	* include/ext/numeric_traits.h [_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT]
	(__numeric_traits<__ibm128>, __numeric_traits<__ieee128>): Define.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.am: Add compatibility-ldbl-alt128.cc and
	compatibility-ldbl-alt128-cxx11.cc sources and recipes for objects.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/compatibility-ldbl-alt128-cxx11.cc: New file defining
	symbols using the old 128-bit long double format, for the cxx11 ABI.
	* src/c++11/compatibility-ldbl-alt128.cc: Likewise, for the
	gcc4-compatible ABI.
	* src/c++11/compatibility-ldbl-facets-aliases.h: New header for long
	double compat aliases.
	* src/c++11/cow-locale_init.cc: Add comment.
	* src/c++11/cxx11-locale-inst.cc: Define C and C_is_char
	unconditionally.
	* src/c++11/cxx11-wlocale-inst.cc: Add sanity check. Include
	locale-inst.cc directly, not via cxx11-locale-inst.cc.
	* src/c++11/locale-inst-monetary.h: New header for monetary
	category instantiations.
	* src/c++11/locale-inst-numeric.h: New header for numeric category
	instantiations.
	* src/c++11/locale-inst.cc: Include new headers for monetary,
	numeric, and long double definitions.
	* src/c++11/wlocale-inst.cc: Remove long double compat aliases that
	are defined in new header now.
	* src/c++17/Makefile.am: Use -mabi=ibmlongdouble for
	floating_from_chars.cc.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++17/floating_from_chars.cc (from_chars_impl): Add
	if-constexpr branch for __ieee128.
	(from_chars): Overload for __ieee128.
	* src/c++20/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++98/locale_init.cc (num_facets): Adjust calculation.
	(locale::_Impl::_Impl(size_t)): Call _M_init_extra_ldbl128.
	* src/c++98/localename.cc (num_facets): Adjust calculation.
	(locale::_Impl::_Impl(const char*, size_t)): Call
	_M_init_extra_ldbl128.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/util/testsuite_abi.cc: Add new symbol versions.
	Allow new symbols to be added to GLIBCXX_IEEE128_3.4.29 and
	CXXABI_IEEE128_1.3.13 too.
	* testsuite/26_numerics/complex/abi_tag.cc: Add u9__ieee128 to
	regex matching expected symbols.
2020-12-16 23:25:01 +00:00
Jonathan Wakely
4d4f82959a libstdc++: Simplify built-in detection in <utility>
Now that GCC supports __has_builtin there is no need to test whether
it's defined, we can just use it unconditionally.

libstdc++-v3/ChangeLog:

	* include/std/utility: Use __has_builtin without checking if
	it's defined.
2020-12-16 19:25:09 +00:00
Jonathan Wakely
767537a8b0 libstdc++: Warn if __STRICT_ANSI has been undefined
Recent changes to use __int128 as an integer-like type in <ranges> and
to optimize std::uniform_int_distribution mean that the library relies
on __int128 more heavily than in the past.

The library expects that if __int128 is supported then either
__GLIBCXX_TYPE_INT_N_0 is defined (and we treat is like the standard
integer types), or __STRICT_ANSI__ is defined (and we need to add
special handling for __int128 as a non-standard integer type).

If users compile with -std=c++NN -U__STRICT_ANSI__ then it puts the
library into a broken and inconsistent state, where the compiler doesn't
define the __GLIBCXX_TYPE_INT_N_0 macro, but the library thinks it
doesn't need special handling for __int128. What the user should do is
compile with -std=gnu++NN instead.

This adds a warning if it appears that __int128 is supported but neither
__GLIBCXX_TYPE_INT_N_0 nor __STRICT_ANSI__ is defined.

libstdc++-v3/ChangeLog:

	* include/bits/c++config: Warn if __STRICT_ANSI__ state is
	inconsistent with __GLIBCXX_TYPE_INT_N_0.
2020-12-16 19:25:09 +00:00