Commit Graph

9171 Commits

Author SHA1 Message Date
Jonathan Wakely 4887c9e808 Fix preprocessor checks for Clang builtins
Clang seems to define built-ins that start with "__builtin_" as
non-keywords, which means that we need to use __has_builtin to detect
them, not __is_identifier. The built-ins that don't start with
"__builtin_" are keywords, and can only be detected using
__is_identifier and not by __has_builtin.

	* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_LAUNDER)
	(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED): Use __has_builtin
	instead of __is_identifier to detect Clang support.

From-SVN: r272931
2019-07-02 12:50:27 +01:00
Jim Wilson 758d7478bf Fix libstdc++ install-pdf support.
Generating pdf files requires everything that is required for the xml files
except the style sheets.

	libstdc++-v3/
	* configure.ac (BUILD_PDF): Also test for doxygen, dot, xsltproc,
	and xmllint.
	* configure: Regenerate.

From-SVN: r272920
2019-07-01 19:30:52 -07:00
Jonathan Wakely e11c487111 PR libstdc++/91012 fixfilesystem_error::what() string
When I refactored the filesystem_error code I changed it to only use the
constructor parameter in the what() string, instead of the string
returned by system_error::what(). That meant it no longer included the
description of the error_code that system_error adds. This restores the
previous behaivour, as encouraged by the standard ("Implementations
should include the system_error::what() string and the pathnames of
path1 and path2 in the native format in the returned string").

	PR libstdc++/91012
	* src/c++17/fs_path.cc (filesystem_error::_Impl): Use a string_view
	for the what_arg parameters.
	(filesystem_error::filesystem_error): Pass system_error::what() to
	the _Impl constructor.
	* testsuite/27_io/filesystem/filesystem_error/cons.cc: Ensure that
	filesystem_error::what() contains system_error::what().

From-SVN: r272739
2019-06-27 10:42:39 +01:00
Jonathan Wakely 22ff8929d7 Define std::chars_format enumeration type
This type isn't used anywhere yet, but will be needed for the
floating-point overloads of to_chars and from_chars.

	* include/std/charconv (chars_format): Define bitmask type.
	* testsuite/20_util/to_chars/chars_format.cc: New test.

From-SVN: r272718
2019-06-26 23:54:38 +01:00
Jonathan Wakely 47f7905440 Add new helper traits for signed/unsigned integer types
Reuse the __is_one_of alias in additional places, and define traits to
check for signed/unsigned integer types so we don't have to duplicate
those checks elsewhere.

The additional overloads for std::byte in <bit> were reviewed by LEWG
and considered undesirable, so this patch removes them.

	* include/bits/fs_path.h (path::__is_encoded_char): Use __is_one_of.
	* include/std/bit (_If_is_unsigned_integer_type): Remove.
	(_If_is_unsigned_integer): Use __is_unsigned_integer.
	(rotl(byte, unsigned), rotr(byte, unsigned), countl_zero(byte))
	(countl_one(byte), countr_zero(byte), countr_one(byte))
	(popcount(byte), ispow2(byte), ceil2(byte), floor2(byte))
	(log2p1(byte)): Remove.
	* include/std/charconv (__detail::__is_one_of): Move to <type_traits>.
	(__detail::__is_int_to_chars_type): Remove.
	(__detail::__integer_to_chars_result_type): Use __is_signed_integer
	and __is_unsigned_integer.
	* include/std/type_traits (__is_one_of): Move here from <charconv>.
	(__is_signed_integer, __is_unsigned_integer): New helpers.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Remove test for
	std::byte overload.
	* testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise.
	* testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise.
	* testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countl_one.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countr_one.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countr_zero.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/popcount.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.rot/rotl.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.rot/rotr.cc: Likewise.

From-SVN: r272695
2019-06-26 15:38:23 +01:00
Jonathan Wakely e88d863cbd Fix non-portable use of std::abs(double) in constexpr function
Although libstdc++ adds 'constexpr' to its std::abs(floating-point)
overloads (as a non-conforming extension), those overloads are not used
if the target libc provides them, which is the case on Solaris.

The fix is to avoid std::abs and simply apply the negation when needed.

	* include/std/numeric (midpoint(T, T)): Avoid std::abs in constexpr
	function.

From-SVN: r272653
2019-06-25 14:18:36 +01:00
Jakub Jelinek 32bab8b6ad pstl_config.h (_PSTL_PRAGMA_SIMD_SCAN, [...]): Define to OpenMP 5.0 pragmas even for GCC 10.0+.
* include/pstl/pstl_config.h (_PSTL_PRAGMA_SIMD_SCAN,
	_PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN, _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN):
	Define to OpenMP 5.0 pragmas even for GCC 10.0+.
	(_PSTL_UDS_PRESENT): Define to 1 for GCC 10.0+.

From-SVN: r272634
2019-06-25 08:59:12 +02:00
Jonathan Wakely a3c8d7fbe2 Fix std::midpoint for denormal values
* include/std/numeric (midpoint(T, T)): Change implementation for
	floating-point types to avoid incorrect rounding of denormals.
	* testsuite/26_numerics/midpoint/floating.cc: Add check for correct
	rounding with denormals.
	* testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line numbers.
	* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.

From-SVN: r272616
2019-06-24 13:09:51 +01:00
Jonathan Wakely ff164b601b Define C11 macros such as FLT_DECIMAL_DIG for C++17
* testsuite/18_support/headers/cfloat/values_c++17.cc: New test.

From-SVN: r272615
2019-06-24 13:09:47 +01:00
Jonathan Wakely 86f73527aa Skip libstdc++ debug build in early bootstrap stages
As mentioned in PR 90770, this is a patch that Debian have been carrying
for some time. The additional unoptimized copies of libstdc++ libs that
get built during each stage are never going to be used, so don't bother
building them.

For a profiled bootstrap this means we won't train the compiler on the
unoptimized library code with assertions enabled, but that doesn't seem
like a big problem, as the same code has already been compiled once for
the main libstdc++ library.

	* acinclude.m4 (GLIBCXX_ENABLE_DEBUG): Only do debug build for final
	stage of bootstrap.
	* configure: Regenerate.

From-SVN: r272509
2019-06-20 15:17:57 +01:00
Jonathan Wakely d306dee31d Qualify calls to __never_valueless in <variant>
* include/std/variant (_Variant_storage, _Extra_visit_slot_needed):
	Qualify calls to __never_valueless.

From-SVN: r272508
2019-06-20 15:17:51 +01:00
Jonathan Wakely 9f35dcd405 Fix outdated reference to C++17 draft in the docs
* doc/xml/manual/status_cxx2017.xml: Fix outdated reference to
	C++17 working draft.

From-SVN: r272500
2019-06-20 10:13:03 +01:00
Jonathan Wakely 94872d7f99 Improve tests for std::vector<bool> printer
The current tests wouldn't notice if the vector<bool> contents were
printed in reverse, because it would read the same forwards and
backwards. Change the content so the tests would fail if that happened.

	* testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic
	vector<bool> for test.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

From-SVN: r272499
2019-06-20 10:04:55 +01:00
Jonathan Wakely 638ad333ec Fix non-standard behaviour of std::istream_iterator
The current implementation of istream_iterator allows the iterator to be
reused after reaching end-of-stream, so that subsequent reads from the
stream can succeed (e.g. if the stream state has been cleared and stream
position changed from EOF). The P0738R2 paper clarified that the
expected behaviour is to set the stream pointer to null after reaching
end-of-stream, preventing further reads.

This implements that requirement, and adds the new default constructor
to std::ostream_iterator.

	* include/bits/stream_iterator.h (istream_iterator::_M_equal()): Make
	private.
	(istream_iterator::_M_read()): Do not check stream state before
	attempting extraction. Set stream pointer to null when extraction
	fails (P0738R2).
	(operator==(const istream_iterator&, const istream_iterator&)): Change
	to be a hidden friend of istream_iterator.
	(operator!=(const istream_iterator&, const istream_iterator&)):
	Likewise.
	(ostream_iterator::ostream_iterator()): Add default constructor.
	(ostream_iterator::ostream_iterator(ostream_type*, const C*)): Use
	addressof.
	* testsuite/24_iterators/istream_iterator/1.cc: New test.
	* testsuite/24_iterators/ostream_iterator/1.cc: New test.
	* testsuite/24_iterators/ostream_iterator/70766.cc: Also check
	constructor taking a string.
	* testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc:
	New test.

From-SVN: r272491
2019-06-19 23:57:10 +01:00
Michael Weghorn 36d0dada67 Have std::vector printer's iterator return bool for vector<bool>
Have the pretty-printer for 'std::vector<bool>' return a
value of type 'bool' rather than an 'int'.

This way, the type is clear and that can be used for better
display and a 'gdb.Value' constructed from the returned value
will have type 'bool' again, not e.g. 'long long' as happened
previously (at least with GDB 8.2.1 on amd64).

2019-06-19  Michael Weghorn  <m.weghorn@posteo.de>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90945
	* python/libstdcxx/v6/printers.py (StdVectorPrinter._iterator): Use
	values of type bool for vector<bool> elements.
	* testsuite/libstdc++-prettyprinters/simple.cc: Test vector<bool>.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r272490
2019-06-19 23:57:06 +01:00
Jonathan Wakely 0fd9e8482e PR libstdc++/90920 restore previous checks for empty ranges
The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.

This restores the old contract of the __rotate overloads.

	PR libstdc++/90920 partially revert r263433
	* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
	(rotate): Remove checks.
	* testsuite/25_algorithms/rotate/90920.cc: New test.

From-SVN: r272489
2019-06-19 23:57:02 +01:00
Jonathan Wakely 74fda2dc9f Fix value category bugs in std::reduce
* include/std/numeric (reduce(Iter, Iter, T, BinOp)): Fix value
	category used in invocable check.
	(reduce(Iter, Iter, T)): Pass initial value as rvalue.
	* testsuite/26_numerics/reduce/2.cc: New test.

From-SVN: r272477
2019-06-19 16:29:49 +01:00
Jonathan Wakely ed920373a5 Implement new serial algorithms from Parallelism TS (P0024R2)
These new (non-parallel) algorithms were added to C++17 along with the
parallel algorithms, but were missing from libstdc++.

	* include/bits/algorithmfwd.h: Change title of doc group.
	* include/bits/stl_algo.h (for_each_n): Add new C++17 algorithm from
	P0024R2.
	* include/bits/stl_numeric.h: Define doc group and add algos to it.
	* include/std/numeric (__is_random_access_iter): New internal trait.
	(reduce, transform_reduce, exclusive_scan, inclusive_scan)
	(transform_exclusive_scan, transform_inclusive_scan): Likewise.
	* testsuite/25_algorithms/for_each/for_each_n.cc: New test.
	* testsuite/26_numerics/exclusive_scan/1.cc: New test.
	* testsuite/26_numerics/inclusive_scan/1.cc: New test.
	* testsuite/26_numerics/reduce/1.cc: New test.
	* testsuite/26_numerics/transform_exclusive_scan/1.cc: New test.
	* testsuite/26_numerics/transform_inclusive_scan/1.cc: New test.
	* testsuite/26_numerics/transform_reduce/1.cc: New test.
	* testsuite/util/testsuite_iterators.h (test_container::size()): New
	member function.

From-SVN: r272459
2019-06-19 00:01:16 +01:00
Jonathan Wakely 0c65926ffa Avoid undefined behaviour in std::byte operators (LWG 2950)
* include/c_global/cstddef (std::byte): Perform arithmetic operations
	in unsigned int to avoid promotion (LWG 2950).

From-SVN: r272415
2019-06-18 12:39:43 +01:00
Jonathan Wakely 39f901e918 Fix AIX test failure due to replacement operator delete
On AIX the sized delete defined in the library will call the non-sized
delete defined in the library, not the replacement version defined in
the test file. By also replacing sized delete we make the test pass
everywhere.

	* testsuite/20_util/allocator/1.cc: Add sized delete, which fixes a
	failure on AIX.

From-SVN: r272391
2019-06-17 16:51:31 +01:00
Jonathan Wakely 360a758ec8 Add 'noexcept' to std::lerp
* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).

From-SVN: r272386
2019-06-17 15:32:44 +01:00
Jonathan Wakely 26b1320ee5 PR libstdc++/90281 Fix string conversions for filesystem::path
Fix several bugs in the encoding conversions for filesystem::path that
prevent conversion of Unicode characters outside the Basic Multilingual
Plane, and prevent returning basic_string specializations with
alternative allocator types.

The std::codecvt_utf8 class template is not suitable for UTF-16
conversions because it uses UCS-2 instead. For conversions between UTF-8
and UTF-16 either std::codecvt<C, char, mbstate> or
codecvt_utf8_utf16<C> must be used.

The __str_codecvt_in and __str_codecvt_out utilities do not
return false on a partial conversion (e.g. for invalid or incomplete
Unicode input). Add new helpers that treat partial conversions as
errors, and use them for all filesystem::path conversions.

	PR libstdc++/90281 Fix string conversions for filesystem::path
	* include/bits/fs_path.h (u8path) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
	Use codecvt_utf8_utf16 instead of codecvt_utf8. Use
	__str_codecvt_in_all to fail for partial conversions and throw on
	error.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS && _GLIBCXX_USE_CHAR8_T]
	(path::_Cvt<char8_t>): Add explicit specialization.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_wconvert): Remove
	overloads.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	if-constexpr instead of dispatching to _S_wconvert. Use codecvt
	instead of codecvt_utf8. Use __str_codecvt_in_all and
	__str_codecvt_out_all.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	codecvt instead of codecvt_utf8. Use __str_codecvt_out_all.
	(path::_S_str_convert) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Construct return values
	with allocator. Use __str_codecvt_out_all. Fallthrough to POSIX code
	after converting to UTF-8.
	(path::_S_str_convert): Use codecvt instead of codecvt_utf8. Use
	__str_codecvt_in_all.
	(path::string): Fix initialization of string types with different
	allocators.
	(path::u8string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Use __str_codecvt_out_all.
	* include/bits/locale_conv.h (__do_str_codecvt): Reorder static and
	runtime conditions.
	(__str_codecvt_out_all, __str_codecvt_in_all): New functions that
	return false for partial conversions.
	* include/experimental/bits/fs_path.h (u8path):
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Implement correctly for mingw.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_wconvert): Add
	missing handling for char8_t. Use codecvt and codecvt_utf8_utf16
	instead of codecvt_utf8. Use __str_codecvt_in_all and
	__str_codecvt_out_all.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	codecvt instead of codecvt_utf8. Use __str_codecvt_out_all.
	(path::string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Construct return values
	with allocator. Use __str_codecvt_out_all and __str_codecvt_in_all.
	(path::string) [!_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	__str_codecvt_in_all.
	(path::u8string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Use __str_codecvt_out_all.
	* src/c++17/fs_path.cc (path::_S_convert_loc): Use
	__str_codecvt_in_all.
	* src/filesystem/path.cc (path::_S_convert_loc): Likewise.
	* testsuite/27_io/filesystem/path/construct/90281.cc: New test.
	* testsuite/27_io/filesystem/path/factory/u8path.cc: New test.
	* testsuite/27_io/filesystem/path/native/string.cc: Test with empty
	strings and with Unicode characters outside the basic multilingual
	plane.
	* testsuite/27_io/filesystem/path/native/alloc.cc: New test.
	* testsuite/experimental/filesystem/path/construct/90281.cc: New test.
	* testsuite/experimental/filesystem/path/factory/u8path.cc: New test.
	* testsuite/experimental/filesystem/path/native/alloc.cc: New test.
	* testsuite/experimental/filesystem/path/native/string.cc: Test with
	empty strings and with Unicode characters outside the basic
	multilingual plane.

From-SVN: r272385
2019-06-17 15:19:04 +01:00
François Dumont b0c849fadb Simplify node ownership in _Hashtable members
Introduce an RAII type to manage nodes in unordered containers while
they are being inserted. If the caller always owns a node until it is
inserted, then the insertion functions don't need to deallocate on
failure. This allows a FIXME in the node re-insertion API to be removed.

Also change extract(const key_type&) to not call extract(const_iterator)
anymore.  This avoids looping through the bucket nodes again to find the
node before the one being extracted.

2019-06-17  François Dumont  <fdumont@gcc.gnu.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/hashtable.h (struct _Hashtable::_Scoped_node): New type.
	(_Hashtable::_M_insert_unique_node): Add key_type parameter. Don't
	deallocate node if insertion fails.
	(_Hashtable::_M_insert_multi_node): Likewise.
	(_Hashtable::_M_reinsert_node): Pass additional key argument.
	(_Hashtable::_M_reinsert_node_multi): Likewise. Remove FIXME.
	(_Hashtable::_M_extract_node(size_t, __node_base*)): New function.
	(_Hashtable::extract(const_iterator)): Use _M_extract_node.
	(_Hashtable::extract(const _Key&)): Likewise.
	(_Hashtable::_M_merge_unique): Pass additional key argument.
	(_Hashtable::_M_emplace<Args>(true_type, Args&&...)): Likewise. Use
	_Scoped_node.
	(_Hashtable::_M_insert): Likewise.
	* include/bits/hashtable_policy.h (_Map_base::operator[]): Likewise.
	(_Hashtable_alloc): Add comments to functions with misleading names.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r272381
2019-06-17 11:25:04 +01:00
Jonathan Wakely 9a9c7a625d Fix tests that fail without PCH
The recent change to stop transitively including <string> broke some
tests, but only when the library is configured without PCH, because
otherwise the <string> header still gets included via the precompiled
<bits/stdc++.h> header.

	* testsuite/20_util/bad_function_call/what.cc: Include <string> header
	for std::string.
	* testsuite/20_util/shared_ptr/cons/weak_ptr_expired.cc: Likewise.
	* testsuite/20_util/tuple/cons/allocator_with_any.cc: Include <memory>
	header for std::allocator.
	* testsuite/23_containers/array/tuple_interface/tuple_element.cc: Add
	using-declaration for std::size_t.
	* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
	Likewise.
	* testsuite/23_containers/deque/cons/55977.cc: Include <istream> for
	std::istream.
	* testsuite/23_containers/vector/cons/55977.cc: Likewise.
	* testsuite/experimental/map/erasure.cc: Include <string> for
	std::string.
	* testsuite/experimental/unordered_map/erasure.cc: Likewise.

From-SVN: r272376
2019-06-17 09:18:17 +01:00
Jonathan Wakely cc28d23496 Disable -Wctor-dtor-privacy warnings for some standard types
* include/experimental/type_traits (experimental::nonesuch): Use
	pragma to disable -Wctor-dtor-privacy warnings.
	* include/std/type_traits (__is_convertible_helper<From, To, false>)
	(__is_nt_convertible_helper<From, To, false>, __nonesuch): Likewise.

From-SVN: r272289
2019-06-14 15:03:20 +01:00
Jonathan Wakely c68c4c982d Add __cpp_lib_bind_front macro to <version> header
* include/std/version (__cpp_lib_bind_front): Add missing macro.

From-SVN: r272288
2019-06-14 15:03:16 +01:00
Jonathan Wakely 95b3d0fda3 Fix incorrect __cpp_lib_parallel_algorithm macro definitions
* include/std/algorithm (__cpp_lib_parallel_algorithm): Fix value.
	* include/std/memory (__cpp_lib_parallel_algorithm): Likewise.
	* include/std/numeric (__cpp_lib_parallel_algorithm): Likewise.
	* testsuite/25_algorithms/pstl/feature_test.cc: New test.

From-SVN: r272216
2019-06-12 21:16:03 +01:00
Jonathan Wakely 801b2266de Improve static_assert messages for std::variant
Also fix a warning with -Wunused-parameter -Wsystem-headers.

	* include/std/variant (get<T>, get<N>, get_if<N>, get_if<T>)
	(variant::emplace): Change static_assert messages from "should be"
	to "must be".
	(hash<monostate>::operator()): Remove name of unused parameter.

From-SVN: r272188
2019-06-12 15:52:09 +01:00
Jonathan Wakely ce657a7414 Simplify std::scoped_lock destructor
* include/std/mutex (scoped_lock::~scoped_lock()): Use fold
	expression.

From-SVN: r272187
2019-06-12 15:52:06 +01:00
Jonathan Wakely cd0b94e650 Replace std::to_string for integers with optimized version
The std::to_chars functions from C++17 can be used to implement
std::to_string with much better performance than calling snprintf. Only
the __detail::__to_chars_len and __detail::__to_chars_10 functions are
needed for to_string, because it always outputs base 10 representations.

The return type of __detail::__to_chars_10 should not be declared before
C++17, so the function body is extracted into a new function that can be
reused by to_string and __detail::__to_chars_10.

The existing tests for to_chars rely on to_string to check for correct
answers. Now that they use the same code that doesn't actually ensure
correctness, so add new tests for std::to_string that compare against
printf output.

	* include/Makefile.am: Add new <bits/charconv.h> header.
	* include/Makefile.in: Regenerate.
	* include/bits/basic_string.h (to_string(int), to_string(unsigned))
	(to_string(long), to_string(unsigned long), to_string(long long))
	(to_string(unsigned long long)): Rewrite to use __to_chars_10_impl.
	* include/bits/charconv.h: New header.
	(__detail::__to_chars_len): Move here from <charconv>.
	(__detail::__to_chars_10_impl): New function extracted from
	__detail::__to_chars_10.
	* include/std/charconv (__cpp_lib_to_chars): Add, but comment out.
	(__to_chars_unsigned_type): New class template that reuses
	__make_unsigned_selector_base::__select to pick a type.
	(__unsigned_least_t): Redefine as __to_chars_unsigned_type<T>::type.
	(__detail::__to_chars_len): Move to new header.
	(__detail::__to_chars_10): Add inline specifier. Move code doing the
	output to __detail::__to_chars_10_impl and call that.
	* include/std/version (__cpp_lib_to_chars): Add, but comment out.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	to_string.cc: Fix reference in comment. Remove unused variable.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	to_string_int.cc: New test.

From-SVN: r272186
2019-06-12 15:52:02 +01:00
Edward Smith-Rowland d37c29f942 Fix ConstexprIterator requirements tests - No constexpr algorithms!
2019-06-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Fix ConstexprIterator requirements tests - No constexpr algorithms!
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	Replace copy with hand-rolled loop.
	* testsuite/23_containers/array/requirements/constexpr_iter.cc:
	Ditto.

From-SVN: r272159
2019-06-11 16:29:35 +00:00
Edward Smith-Rowland 79f31e3d18 Test for C++20 p0858 - ConstexprIterator requirements.
2019-06-08  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Test for C++20 p0858 - ConstexprIterator requirements.
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	New test.
	* testsuite/23_containers/array/requirements/constexpr_iter.cc:
	New test.

From-SVN: r272085
2019-06-08 22:18:36 +00:00
Thomas Rodgers f32ee8a25e Synchronize libstdc++ PSTL with upstream LLVM PSTL
Rename PSTL macro's consistent with libstdc++ (and llvm upstream
	project) standards.
	* include/bits/c++config: Rename all macros of the form __PSTL* to
	_PSTL*.
	* include/std/algorithm: Likewise.
	* include/std/execution: Likewise.
	* include/std/numeric: Likewise.
	* include/std/memory: Likewise.
	* include/pstl/glue_memory_impl.h: Likewise.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/glue_memory_defs.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/utils.h: Likewise.
	* include/pstl/algorithm_fwd.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/parallel_impl.h: Likewise.
	* include/pstl/memory_impl.h: Likewise.
	* include/pstl/glue_numeric_defs.h: Likewise.
	* include/pstl/parallel_backend_utils.h: Likewise.
	* include/pstl/glue_algorithm_defs.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/glue_numeric_impl.h: Likewise.
	* include/pstl/parallel_backend_tbb.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* testsuite/util/pstl/pstl_test_config.h: Likewise.
	* testsuite/util/pstl/test_utils.h: Likewise.
	* testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc:
	Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc:
	Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/scan.cc: Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc: Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/reduce.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc: Likewise.

	Rename header guards to be consistent with upstream project's
	conventions.
	* include/pstl/glue_memory_impl.h: Rename all macros of the form
	_PSTL_(.*)_H to _PSTL_\U\1_H.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/glue_memory_defs.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/utils.h: Likewise.
	* include/pstl/algorithm_fwd.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/parallel_impl.h: Likewise.
	* include/pstl/memory_impl.h: Likewise.
	* include/pstl/glue_numeric_defs.h: Likewise.
	* include/pstl/parallel_backend_utils.h: Likewise.
	* include/pstl/glue_algorithm_defs.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/glue_numeric_impl.h: Likewise.
	* include/pstl/parallel_backend_tbb.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* testsuite/util/pstl/pstl_test_config.h: Likewise.

	Synchronize libstdc++ parallel algorithms with upstream
	project.
	* include/pstl/algorithm_fwd.h: Synchronize with
	upstream PSTL project.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/parallel_backend_serial.h: New file.
	* include/Makefile.am (pstl_headers): Add
	parallel_backend_serial.h.
	* include/Makefile.in: Regenerate.

	Clean up non-conforming names
	* include/pstl/algorithm_impl.h (__parallel_set_union_op):
	Uglfiy copy_range1 and copy_range2
	(__pattern_walk2_n): Rename local n to __n
	* include/pstl/parallel_backend_tbb.h (struct __binary_no_op):
	Rename parameter _T to _Tp.

	Integrate non-TBB serial backend support
	* include/bits/c++config: Adjust TBB detection logic to select serial
	PSTL backend if no TBB present.
	* testsuite/utils/pstl/test_utils.h: Remove check for
	_PSTL_USE_PAR_POLICIES

From-SVN: r272056
2019-06-07 22:01:16 +00:00
Jonathan Wakely c1b4c4f491 Fix test that gets skipped as unsupported
* testsuite/24_iterators/container_access.cc: Move dg-options before
	dg-do directive so the target check uses the -std option.

From-SVN: r272051
2019-06-07 20:57:28 +01:00
Jonathan Wakely 2b32668568 PR libstdc++/90770 fix missing src/debug/Makefile
PR libstdc++/90770
	* configure: Regenerate.
	* src/Makefile.am (stamp-debug): Also test for missing makefile.
	* src/Makefile.in: Regenerate.

From-SVN: r272050
2019-06-07 20:57:19 +01:00
Jonathan Wakely beb0086f59 Avoid unnecessary inclusion of <stdexcept> header
This can greatly reduce the amount of preprocessed code that is included
by other headers, because <stdexcept> depends on <string> which is huge.

	* include/std/array: Do not include <stdexcept>.
	* include/std/optional: Include <exception> and
	<bits/exception_defines.h> instead of <stdexcept>.
	* testsuite/20_util/function_objects/searchers.cc: Include <cctype>
	for std::isalnum.
	* testsuite/20_util/tuple/cons/deduction.cc: Include <memory> for
	std::allocator.
	* testsuite/23_containers/map/erasure.cc: Include <string>.
	* testsuite/23_containers/unordered_map/erasure.cc: Likewise.

From-SVN: r272011
2019-06-06 16:34:56 +01:00
Jonathan Wakely ad60f42883 Fix more failing tests for C++98 mode
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Add
	dg-prune-output for different C++98 diagnostic.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/libstdc++-prettyprinters/compat.cc: Do not run for C++98.

From-SVN: r272010
2019-06-06 16:34:51 +01:00
Jonathan Wakely d561a18ee6 Fix more tests that fail in C++2a mode
* testsuite/23_containers/unordered_map/requirements/debug_container.cc:
	Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Change
	dg-do directive for C++17 and C++2a.

From-SVN: r272009
2019-06-06 16:34:45 +01:00
Jonathan Wakely a2dbc0bf2a Fix tests that fail in C++2a mode
The GNU extension that allows using the wrong allocator type with a
container is disabled for C++2a mode, because the standard now requires
a diagnostic. Fix the tests that fail when -std=gnu++2a is used.

Also remove some reundant tests that are duplicates of another test
except for a target specifier of c++11. Those tests previously set
-std=gnu++11 explicitly but that was replaced globally with a target
specifier. These tests existed to verify that explicit instantiation
worked for both C++98 and C++11 modes, but now do nothing because both
copies of the test use -std=gnu++14 by default. Instead of duplicating
the test we should be regularly running the whole testsuite with
different -std options.

	* testsuite/23_containers/deque/requirements/explicit_instantiation/
	1_c++0x.cc: Remove redundant test.
	* testsuite/23_containers/deque/requirements/explicit_instantiation/
	2.cc: Use target selector instead of preprocessor condition.
	* testsuite/23_containers/deque/requirements/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/forward_list/requirements/
	explicit_instantiation/3.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/
	explicit_instantiation/5.cc: Do not test allocator rebinding extension
	for C++2a.
	* testsuite/23_containers/list/requirements/explicit_instantiation/
	1_c++0x.cc: Remove redundant test.
	* testsuite/23_containers/list/requirements/explicit_instantiation/
	2.cc: Use target selector instead of preprocessor condition.
	* testsuite/23_containers/list/requirements/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/list/requirements/explicit_instantiation/
	5.cc: Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/map/requirements/explicit_instantiation/
	1_c++0x.cc: Remove redundant test.
	* testsuite/23_containers/map/requirements/explicit_instantiation/
	2.cc: Adjust comment.
	* testsuite/23_containers/map/requirements/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/map/requirements/explicit_instantiation/
	5.cc: Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/multimap/requirements/explicit_instantiation/
	1_c++0x.cc: Remove redundant test.
	* testsuite/23_containers/multimap/requirements/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/multimap/requirements/explicit_instantiation/
	5.cc: Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/multiset/requirements/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/multiset/requirements/explicit_instantiation/
	5.cc: Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/set/requirements/explicit_instantiation/3.cc:
	Do not run test for C++2a.
	* testsuite/23_containers/set/requirements/explicit_instantiation/
	1_c++0x.cc: Remove redundant test.
	* testsuite/23_containers/set/requirements/explicit_instantiation/5.cc:
	Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/unordered_map/requirements/
	explicit_instantiation/3.cc: Likewise.
	* testsuite/23_containers/unordered_map/requirements/
	explicit_instantiation/5.cc: Do not test allocator rebinding extension
	for C++2a.
	* testsuite/23_containers/unordered_multimap/requirements/
	explicit_instantiation/3.cc: Do not run test for C++2a.
	* testsuite/23_containers/unordered_multimap/requirements/
	explicit_instantiation/5.cc: Do not test allocator rebinding extension
	for C++2a.
	* testsuite/23_containers/unordered_multiset/requirements/
	explicit_instantiation/3.cc: Do not run test for C++2a.
	* testsuite/23_containers/unordered_multiset/requirements/
	explicit_instantiation/5.cc: Do not test allocator rebinding extension
	for C++2a.
	* testsuite/23_containers/unordered_set/requirements/
	explicit_instantiation/3.cc: Do not run test for C++2a.
	* testsuite/23_containers/unordered_set/requirements/
	explicit_instantiation/5.cc: Do not test allocator rebinding extension
	for C++2a.
	* testsuite/23_containers/vector/ext_pointer/explicit_instantiation/
	2.cc: Remove redundant test.
	* testsuite/23_containers/vector/ext_pointer/explicit_instantiation/
	3.cc: Do not run test for C++2a.
	* testsuite/23_containers/vector/requirements/explicit_instantiation/
	3.cc: Likewise.

From-SVN: r272001
2019-06-06 14:36:27 +01:00
Jonathan Wakely 209ee62421 Remove redundant static assertions in [meta.unary.prop] traits
The type property predicates that are implemented by a compiler builtin
already do the right checks in the compiler. The checks for complete
type or unbounded arrays were wrong for these types anyway.

	* include/std/type_traits (is_empty, is_polymorphic, is_final)
	(is_abstract, is_aggregate): Remove static_assert.
	* testsuite/20_util/is_abstract/incomplete_neg.cc: Check for error
	from builtin only.
	* testsuite/20_util/is_aggregate/incomplete_neg.cc: Likewise. Add
	missing -std=gnu++17 option.
	* testsuite/20_util/is_empty/incomplete_neg.cc: New test.
	* testsuite/20_util/is_final/incomplete_neg.cc: New test.
	* testsuite/20_util/is_polymorphic/incomplete_neg.cc: Check for error
	from builtin only.

From-SVN: r272000
2019-06-06 13:13:47 +01:00
Jonathan Wakely 061a745005 Fix tests that fail with -std=gnu++98 or -std=gnu++11
* testsuite/18_support/set_terminate.cc: Do not run for C++98 mode.
	* testsuite/18_support/set_unexpected.cc: Likewise.
	* testsuite/20_util/is_nothrow_invocable/value.cc: Test converting to
	void.
	* testsuite/20_util/is_nothrow_invocable/value_ext.cc: Fix constexpr
	function to be valid in C++11.
	* testsuite/26_numerics/complex/proj.cc: Do not run for C++98 mode.
	* testsuite/experimental/names.cc: Do not run for C++98 mode. Do not
	include Library Fundamentals or Networking headers in C++11 mode.
	* testsuite/ext/char8_t/atomic-1.cc: Do not run for C++98 mode.

From-SVN: r271999
2019-06-06 13:13:42 +01:00
Jonathan Wakely d355635e6b Refactor SFINAE constraints on std::tuple constructors
Replace the _TC class template with the better-named _TupleConstraints
one, which provides a different set of member functions. The new members
do not distinguish construction from lvalues and rvalues, but expects
the caller to do that by providing different template arguments. Within
the std::tuple primary template and std::tuple<T1, T2> partial
specialization the _TupleConstraints members are used via new alias
templates like _ImplicitCtor and _ExplicitCtor which makes the
constructor constraints less verbose and repetitive. For example, where
we previously had:

     template<typename... _UElements, typename
             enable_if<
                _TMC<_UElements...>::template
                   _MoveConstructibleTuple<_UElements...>()
                 && _TMC<_UElements...>::template
                   _ImplicitlyMoveConvertibleTuple<_UElements...>()
                 && (sizeof...(_Elements) >= 1),
       bool>::type=true>
       constexpr tuple(_UElements&&... __elements)

We now have:

     template<typename... _UElements,
             bool _Valid = __valid_args<_UElements...>(),
             _ImplicitCtor<_Valid, _UElements...> = true>
      constexpr
      tuple(_UElements&&... __elements)

There are two semantic changes as a result of the refactoring:

- The allocator-extended default constructor is now constrained.
- The rewritten constraints fix PR 90700.

	* include/std/tuple (_TC): Replace with _TupleConstraints.
	(_TupleConstraints): New helper for SFINAE constraints, with more
	expressive member functions to reduce duplication when used.
	(tuple::_TC2, tuple::_TMC, tuple::_TNTC): Remove.
	(tuple::_TCC): Replace dummy type parameter with bool non-type
	parameter that can be used to check the pack size.
	(tuple::_ImplicitDefaultCtor, tuple::_ExplicitDefaultCtor)
	(tuple::_ImplicitCtor, tuple::_ExplicitCtor): New alias templates for
	checking constraints in constructors.
	(tuple::__valid_args, tuple::_UseOtherCtor, tuple::__use_other_ctor):
	New SFINAE helpers.
	(tuple::tuple): Use new helpers to reduce repitition in constraints.
	(tuple::tuple(allocator_arg_t, const Alloc&)): Constrain.
	(tuple<T1, T2>::_TCC, tuple<T1, T2>::_ImplicitDefaultCtor)
	(tuple<T1, T2>::_ExplicitDefaultCtor, tuple<T1, T2>::_ImplicitCtor)
	(tuple<T1, T2>::_ExplicitCtor): New alias templates for checking
	constraints in constructors.
	(tuple::__is_alloc_arg()): New SFINAE helpers.
	(tuple<T1, T2>::tuple): Use new helpers to reduce repitition in
	constraints.
	(tuple<T1, T2>::tuple(allocator_arg_t, const Alloc&)): Constrain.
	* testsuite/20_util/tuple/cons/90700.cc: New test.
	* testsuite/20_util/tuple/cons/allocators.cc: Add default constructor
	to meet new constraint on allocator-extended default constructor.

From-SVN: r271998
2019-06-06 13:13:36 +01:00
Jonathan Wakely ffef1e30a7 Fix uses of static_assert not guarded by C++11 check
* include/bits/stl_map.h (map): Disable static assert for C++98 mode.
	* include/bits/stl_multimap.h (multimap): Likewise.

From-SVN: r271884
2019-06-03 23:18:31 +01:00
François Dumont 7cfe71d1d2 Rename variables and cleanup comments.
2019-06-03  François Dumont  <fdumont@gcc.gnu.org>

	Rename variables and cleanup comments.
	* include/bits/hashtable_policy.h
	* include/bits/hashtable.h

From-SVN: r271876
2019-06-03 17:08:34 +00:00
Jonathan Wakely bf5824f928 Corrections for C++2a library status table
* doc/xml/manual/status_cxx2020.xml: Add missing row for P0920R2.
	Fix bgcolor for P0340R3.
	* doc/html/*: Regenerate.

From-SVN: r271868
2019-06-03 14:32:17 +01:00
Jonathan Wakely 512a80ec49 PR libstdc++/90686 update C++2a library status docs
PR libstdc++/90686
	* doc/xml/manual/status_cxx2014.xml: Document what's missing from
	<experimental/memory_resource>.
	* doc/xml/manual/status_cxx2020.xml: Document status of P1285R0,
	P0339R6, P0340R3, P1164R1 and P1357R1.
	* doc/html/*: Regenerate.

From-SVN: r271867
2019-06-03 14:23:03 +01:00
Jonathan Wakely ebaf365963 Enforce allocator::value_type consistency for containers in C++2a
In previous standards it is undefined for a container and its allocator
to have a different value_type. Libstdc++ has traditionally allowed it
as an extension, automatically rebinding the allocator to the
container's value_type. Since GCC 8.1 that extension has been disabled
for C++11 and later when __STRICT_ANSI__ is defined (i.e. for
-std=c++11, -std=c++14, -std=c++17 and -std=c++2a).

Since the acceptance of P1463R1 into the C++2a draft an incorrect
allocator::value_type now requires a diagnostic. This patch implements
that by enabling the static_assert for -std=gnu++2a as well.

	* doc/xml/manual/status_cxx2020.xml: Document P1463R1 status.
	* include/bits/forward_list.h [__cplusplus > 201703]: Enable
	allocator::value_type assertion for C++2a.
	* include/bits/hashtable.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* testsuite/23_containers/deque/48101-3_neg.cc: New test.
	* testsuite/23_containers/forward_list/48101-3_neg.cc: New test.
	* testsuite/23_containers/list/48101-3_neg.cc: New test.
	* testsuite/23_containers/map/48101-3_neg.cc: New test.
	* testsuite/23_containers/multimap/48101-3_neg.cc: New test.
	* testsuite/23_containers/multiset/48101-3_neg.cc: New test.
	* testsuite/23_containers/set/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_map/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_multimap/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_multiset/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_set/48101-3_neg.cc: New test.
	* testsuite/23_containers/vector/48101-3_neg.cc: New test.

From-SVN: r271866
2019-06-03 14:22:59 +01:00
Gerald Pfeifer d030d4c5a4 * doc/xml/manual/allocator.xml: Move hoard.org back to http.
From-SVN: r271827
2019-05-31 22:26:55 +00:00
Jonathan Wakely b1bb4869e2 Add noexcept to tuple<> and simplify tuple<T1,T2> noexcept-specifiers
* include/std/tuple (tuple<>): Add noexcept to allocator-extended
	constructors.
	(tuple<T1, T2>::__nothrow_default_constructible()): New helper
	function.
	(tuple<T1, T2>::tuple(), explicit tuple<T1, T2>::tuple()): Use helper.

From-SVN: r271814
2019-05-31 15:58:05 +01:00
Jonathan Wakely ff0b7e883d Fix breakage due to removing __gnu_cxx::size_t declaration
Restore the using-declaration but locally in the source file, not in the
header.

	* src/c++98/bitmap_allocator.cc: Add using-declaration for size_t.

From-SVN: r271812
2019-05-31 14:59:19 +01:00