Commit Graph

192 Commits

Author SHA1 Message Date
Tom Honermann 59019b4223 P0482R5 char8_t: Updates to existing standard library tests
This patch augments existing tests to validate behavior for char8_t.  In
all cases, added test cases are cloned from existing tests for wchar_t
or char16_t.

A few tests required updates to line numbers for diagnostic messages.

2019-02-22  Tom Honermann  <tom@honermann.net>

	* testsuite/18_support/byte/ops.cc: Validate
	std::to_integer<char8_t>, std::to_integer<char16_t>, and
	std::to_integer<char32_t>.
	* testsuite/18_support/numeric_limits/dr559.cc: Validate
	std::numeric_limits<char8_t>.
	* testsuite/18_support/numeric_limits/lowest.cc: Validate
	std::numeric_limits<char8_t>::lowest().
	* testsuite/18_support/numeric_limits/max_digits10.cc: Validate
	std::numeric_limits<char8_t>::max_digits10.
	* testsuite/18_support/type_info/fundamental.cc: Validate
	typeinfo for char8_t.
	* testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating
	std::from_chars with char8_t.
	* testsuite/20_util/hash/requirements/explicit_instantiation.cc:
	Validate explicit instantiation of std::hash<char8_t>.
	* testsuite/20_util/is_integral/value.cc: Validate
	std::is_integral<char8_t>.
	* testsuite/20_util/make_signed/requirements/typedefs-4.cc:
	Validate std::make_signed<char8_t>.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc:
	Validate u8string construction from char8_t sources.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate
	std::pmr::u8string.
	* testsuite/21_strings/basic_string_view/operations/compare/
	char/70483.cc: Validate substr operations on u8string_view.
	* testsuite/21_strings/basic_string_view/typedefs.cc: Validate that
	the u8string_view typedef is defined.
	* testsuite/21_strings/char_traits/requirements/
	constexpr_functions.cc: Validate char_traits<char8_t> constexpr
	member functions.
	* testsuite/21_strings/char_traits/requirements/
	constexpr_functions_c++17.cc: Validate char_traits<char8_t> C++17
	constexpr member functions.
	* testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate
	that the u8string typedef is defined.
	* testsuite/22_locale/locale/cons/unicode.cc: Validate the presence
	of the std::codecvt<char16_t, char8_t, std::mbstate_t> and
	std::codecvt<char32_t, char8_t, std::mbstate_t> facets.
	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line
	numbers.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc:
	Likewise.
	* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
	* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc:
	Validate std::atomic<char8_t>::is_always_lock_free
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
	Update line numbers.
	* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc:
	Likewise.
	* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc:
	Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	Validate std::experimental::pmr::u8string.
	* testsuite/experimental/string_view/typedefs.cc: Validate that the
	u8string_view typedef is defined.
	* testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and
	char32_t to the typelists.

From-SVN: r269089
2019-02-22 01:16:08 +00:00
Jonathan Wakely 102a4fe17e Adjust C++11/C++14 tests to work with -fchar8_t
* testsuite/21_strings/basic_string/literals/types.cc
	[_GLIBCXX_USE_CHAR8_T]: Adjust expected string type for u8 literal.
	* testsuite/21_strings/basic_string/literals/values.cc
	[_GLIBCXX_USE_CHAR8_T]: Likewise.
	* testsuite/22_locale/codecvt/char16_t.cc: Adjust for u8 literals
	potentially having different type.
	* testsuite/22_locale/codecvt/char32_t.cc: Likewise.
	* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Cast u8 literal
	to char.
	* testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: Likewise.
	* testsuite/22_locale/codecvt/utf8.cc: Likewise.
	* testsuite/22_locale/conversions/string/2.cc: Remove u8 prefix from
	string literals only using basic character set.
	* testsuite/22_locale/conversions/string/3.cc: Likewise. Cast other
	u8 literals to char.
	* testsuite/29_atomics/headers/atomic/macros.cc [_GLIBCXX_USE_CHAR8_T]:
	Test ATOMIC_CHAR8_T_LOCK_FREE.
	Add missing #error to ATOMIC_CHAR16_T_LOCK_FREE test.
	* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc
	[_GLIBCXX_USE_CHAR8_T]: Check for std::atomic_char8_t.
	* testsuite/experimental/string_view/literals/types.cc
	[_GLIBCXX_USE_CHAR8_T]: Adjust expected string_view type for u8
	literal.
	* testsuite/experimental/string_view/literals/values.cc
	[_GLIBCXX_USE_CHAR8_T]: Likewise.

From-SVN: r269006
2019-02-19 02:55:12 +00:00
Tom Honermann 46ca1dd73c P0482R5 char8_t: New standard library tests
2019-02-19  Tom Honermann  <tom@honermann.net>

	* testsuite/18_support/numeric_limits/char8_t.cc: New test cloned
	from char16_32_t.cc; validates numeric_limits<char8_t>.
	* testsuite/21_strings/basic_string/literals/types-char8_t.cc: New
	test cloned from types.cc; validates operator""s for char8_t
	returns u8string.
	* testsuite/21_strings/basic_string/literals/values-char8_t.cc: New
	test cloned from values.cc; validates construction and comparison
	of u8string values.
	* testsuite/21_strings/basic_string/requirements/
	/explicit_instantiation/char8_t/1.cc: New test cloned from
	char16_t/1.cc; validates explicit instantiation of
	basic_string<char8_t>.
	* testsuite/21_strings/basic_string_view/literals/types-char8_t.cc:
	New test cloned from types.cc; validates operator""sv for char8_t
	returns u8string_view.
	* testsuite/21_strings/basic_string_view/literals/
	values-char8_t.cc: New test cloned from values.cc; validates
	construction and comparison of u8string_view values.
	* testsuite/21_strings/basic_string_view/requirements/
	explicit_instantiation/char8_t/1.cc: New test cloned from
	char16_t/1.cc; validates explicit instantiation of
	basic_string_view<char8_t>.
	* testsuite/21_strings/char_traits/requirements/char8_t/65049.cc:
	New test cloned from char16_t/65049.cc; validates that
	char_traits<char8_t> is not vulnerable to the concerns in PR65049.
	* testsuite/21_strings/char_traits/requirements/char8_t/
	typedefs.cc: New test cloned from char16_t/typedefs.cc; validates
	that char_traits<char8_t> member typedefs are present and correct.
	* testsuite/21_strings/char_traits/requirements/
	explicit_instantiation/char8_t/1.cc: New test cloned from
	char16_t/1.cc; validates explicit instantiation of
	char_traits<char8_t>.
	* testsuite/22_locale/codecvt/char16_t-char8_t.cc: New test cloned
	from char16_t.cc: validates
	codecvt<char16_t, char8_t, mbstate_t>.
	* testsuite/22_locale/codecvt/char32_t-char8_t.cc: New test cloned
	from char32_t.cc: validates
	codecvt<char32_t, char8_t, mbstate_t>.
	* testsuite/22_locale/codecvt/utf8-char8_t.cc: New test cloned from
	utf8.cc; validates codecvt<char16_t, char8_t, std::mbstate_t> and
	codecvt<char32_t, char8_t, std::mbstate_t>.
	* testsuite/27_io/filesystem/path/native/string-char8_t.cc: New
	test cloned from string.cc; validates filesystem::path construction
	from char8_t input.
	* testsuite/experimental/feat-char8_t.cc: New test; validates that
	the __cpp_lib_char8_t feature test macro is defined with the
	correct value.
	* testsuite/experimental/filesystem/path/native/string-char8_t.cc:
	New test cloned from string.cc; validates filesystem::path
	construction from char8_t input.
	* testsuite/experimental/string_view/literals/types-char8_t.cc: New
	test cloned from types.cc; validates operator""sv for char8_t
	returns u8string_view.
	* testsuite/experimental/string_view/literals/values-char8_t.cc:
	New test cloned from values.cc; validates construction and
	comparison of u8string_view values.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char8_t/1.cc: New test cloned from
	char16_t/1.cc; validates explicit instantiation of
	basic_string_view<char8_t>.
	* testsuite/ext/char8_t/atomic-1.cc: New test; validates that
	ATOMIC_CHAR8_T_LOCK_FREE is not defined if char8_t support is not
	enabled.

From-SVN: r269005
2019-02-19 02:55:05 +00:00
Jonathan Wakely 4ff3e65090 Add allocator-extended copy/move ctors to COW string
Add these constructors from C++11 which were missing from the COW
basic_string. Additionally simplify the definitions of the
basic_string::reference and basic_string::const_reference types as
required by C++11.

This allows filesystem::path::string<Allocator>() to be simplified, so
that the same code is used for both basic_string implementations.

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export allocator-extended
	copy/move constructors for old std::basic_string.
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::reference, basic_string::const_reference): Define
	as plain references for C++11 and later.
	(basic_string::basic_string()): Put constructor body outside
	preprocessor conditional groups.
	(basic_string::basic_string(basic_string&&)): Move _Alloc_hider
	instead of copying it.
	(basic_string::basic_string(const basic_string&, const _Alloc&)):
	Define.
	(basic_string::basic_string(basic_string&&, const _Alloc&)):
	Define.
	* include/bits/fs_path.h [!_GLIBCXX_USE_CXX11_ABI]: Remove special
	cases for old basic_string.
	* testsuite/21_strings/basic_string/cons/char/8.cc: Test
	allocator-extended constructors unconditionally. Add extra members to
	allocator type when using old string ABI.
	* testsuite/21_strings/basic_string/allocator/71964.cc: Enable test
	for old string ABI.
	* testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.

From-SVN: r267584
2019-01-04 23:23:17 +00:00
Jonathan Wakely 9fc5a9a144 Remove XFAIL from test that no longer fails
This test started passing with the old ABI with r263808, so doesn't need
to be marked XFAIL now.

	* testsuite/21_strings/basic_string/requirements/
	explicit_instantiation/debug.cc: Remove XFAIL for old ABI.

From-SVN: r267578
2019-01-04 16:07:06 +00:00
Jonathan Wakely 5db78cac10 Avoid spurious test failures when -fno-inline in test flags
These tests rely on inlining, so if -fno-inline is added to the compiler
flags the tests fail. Use the predefined __NO_INLINE__ macro to detect
that situation, and don't bother testing the move assignment.

	* testsuite/21_strings/basic_string/modifiers/assign/char/
	move_assign_optim.cc: Avoid spurious failure when -fno-inline added
	to test flags.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
	move_assign_optim.cc: Likewise.

From-SVN: r267573
2019-01-04 11:06:49 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Edward Smith-Rowland 5bd624fbde Implement P0457R2 String Prefix and Suffix Checking.
2018-11-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement P0457R2 String Prefix and Suffix Checking.
	* include/bits/basic_string.h: Add starts_with, ends_with members.
	* include/std/string_view: Ditto.
	* testsuite/21_strings/basic_string/operations/starts_with/
	char/1.cc: New test.
	* testsuite/21_strings/basic_string/operations/starts_with/
	wchar_t/1.cc: New test.
	* testsuite/21_strings/basic_string/operations/ends_with/
	char/1.cc: New test.
	* testsuite/21_strings/basic_string/operations/ends_with/
	wchar_t/1.cc: New test.
	* testsuite/21_strings/basic_string_view/operations/starts_with/
	char/1.cc: New test.
	* testsuite/21_strings/basic_string_view/operations/starts_with/
	wchar_t/1.cc: New test.
	* testsuite/21_strings/basic_string_view/operations/ends_with/
	char/1.cc: New test.
	* testsuite/21_strings/basic_string_view/operations/ends_with/
	wchar_t/1.cc: New test.

From-SVN: r266674
2018-11-30 16:26:02 +00:00
Edward Smith-Rowland 0b44b4b807 Pre-emptively support P0646R1 for std container erasure.
2018-11-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Pre-emptively support P0646R1 for std container erasure.
	* include/bits/erase_if.h: Accumulate and return number of erased nodes.
	* include/std/forward_list (): Return number of erased items.
	* include/std/list (): Ditto.
	* include/std/map (): Ditto.
	* include/std/set (): Ditto.
	* include/std/string (): Ditto.
	* include/std/unordered_map (): Ditto.
	* include/std/unordered_set (): Ditto.
	* include/std/vector (): Ditto.
	* testsuite/21_strings/basic_string/erasure.cc: Test number of erasures.
	* testsuite/23_containers/deque/erasure.cc: Ditto.
	* testsuite/23_containers/forward_list/erasure.cc: Ditto.
	* testsuite/23_containers/list/erasure.cc: Ditto.
	* testsuite/23_containers/map/erasure.cc: Ditto.
	* testsuite/23_containers/set/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_map/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_set/erasure.cc: Ditto.
	* testsuite/23_containers/vector/erasure.cc: Ditto.

From-SVN: r266672
2018-11-30 16:12:13 +00:00
Edward Smith-Rowland a62b871d65 Fix erasure goofs.
2018-11-29  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Fix erasure goofs.
	* include/experimental/deque: Make inline.
	* include/std/deque: Include bits/stl_algo.h.
	(erase, erase_if): Make inline.
	* include/std/string: Include bits/stl_algo.h.
	* include/std/unordered_set: Add erase, erase_if!
	* include/std/vector: Include bits/stl_algo.h.
	* testsuite/21_strings/basic_string/erasure.cc:
	Add { dg-options "-std=gnu++2a" }.
	* testsuite/23_containers/deque/erasure.cc: Ditto.
	* testsuite/23_containers/forward_list/erasure.cc: Ditto.
	* testsuite/23_containers/list/erasure.cc: Ditto.
	* testsuite/23_containers/map/erasure.cc: Ditto.
	* testsuite/23_containers/set/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_map/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_set/erasure.cc: Ditto.
	* testsuite/23_containers/vector/erasure.cc: Ditto.

From-SVN: r266616
2018-11-29 13:43:55 +00:00
Edward Smith-Rowland 188588e443 Implement uniform container erasure for C++20.
2018-11-28  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement uniform container erasure for C++20.
	* include/Makefile.am: Move erase_if.h.
	* include/Makefile.in: Move erase_if.h.
	* include/experimental/bits/erase_if.h: Move ...
	* include/bits/erase_if.h: ... here.
	* include/experimental/map: Move erase_if.h.
	* include/experimental/set: Move erase_if.h.
	* include/experimental/unordered_map: Move erase_if.h.
	* include/experimental/unordered_set: Move erase_if.h.
	* include/std/deque (erase_if, erase): New functions.
	* include/std/forward_list: Ditto.
	* include/std/list: Ditto.
	* include/std/map: Ditto.
	* include/std/set: Ditto.
	* include/std/string: Ditto.
	* include/std/unordered_map: Ditto.
	* include/std/unordered_set: Ditto.
	* include/std/vector: Ditto.
	* testsuite/21_strings/basic_string/erasure.cc: New test.
	* testsuite/23_containers/deque/erasure.cc: New test.
	* testsuite/23_containers/forward_list/erasure.cc: New test.
	* testsuite/23_containers/list/erasure.cc: New test.
	* testsuite/23_containers/map/erasure.cc: New test.
	* testsuite/23_containers/set/erasure.cc: New test.
	* testsuite/23_containers/unordered_map/erasure.cc: New test.
	* testsuite/23_containers/unordered_set/erasure.cc: New test.
	* testsuite/23_containers/vector/erasure.cc: New test.

From-SVN: r266567
2018-11-28 16:44:25 +00:00
Jonathan Wakely 71e093897c PR libstdc++/87749 fix (and optimize) string move construction
The move constructor for the SSO string uses assign(const basic_string&)
when either:

(1) the source string is "local" and so the contents of the small string
buffer need to be copied, or

(2) the allocator does not propagate and is_always_equal is false.

Case (1) is suboptimal, because the assign member is not noexcept and
the compiler isn't smart enough to see it won't actually throw in this
case. This causes extra code in the move assignment operator so that any
exception will be turned into a call to std::terminate. This can be
fixed by copying small strings inline instead of calling assign.

Case (2) is a bug, because the specific instances of the allocators
could be equal even if is_always_equal is false. This can result in an
unnecessary deep copy (and potentially-throwing allocation) when the
storage should be moved. This can be fixed by simply checking if the
allocators are equal.

	PR libstdc++/87749
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::operator=(basic_string&&)): For short strings copy the
	buffer inline. Only fall back to using assign(const basic_string&) to
	do a deep copy when reallocation is needed.
	* testsuite/21_strings/basic_string/modifiers/assign/char/87749.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/assign/char/
	move_assign_optim.cc: New test.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/87749.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
	move_assign_optim.cc: New test.

From-SVN: r265493
2018-10-25 16:34:04 +01:00
Sandra Loosemore 6cec3c81a7 10.cc: Add dg-require-fileio.
2018-08-31  Sandra Loosemore  <sandra@codesourcery.com>

	libstdc++-v3/

	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc:
	Add dg-require-fileio.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc:
	Likewise.
	* testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc:
	Likewise.
	* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise.
	* testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc: Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/11543.cc: Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc: Likewise.
	* testsuite/27_io/basic_ifstream/cons/wchar_t/1.cc: Likewise.
	* testsuite/27_io/basic_ifstream/open/wchar_t/1.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_character/wchar_t/4.cc:
	Likewise.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc:
	Likewise.
	* testsuite/27_io/basic_istream/get/wchar_t/2.cc: Likewise.
	* testsuite/27_io/basic_istream/getline/wchar_t/5.cc: Likewise.
	* testsuite/27_io/basic_istream/ignore/wchar_t/2.cc: Likewise.
	* testsuite/27_io/basic_istream/ignore/wchar_t/3.cc: Likewise.
	* testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc: Likewise.
	* testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc: Likewise.
	* testsuite/27_io/basic_ofstream/cons/wchar_t/1.cc: Likewise.
	* testsuite/27_io/basic_ofstream/open/wchar_t/1.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc:
	Likewise.
	* testsuite/27_io/objects/wchar_t/10.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/12048-1.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/12048-2.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/12048-3.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/12048-4.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/12048-5.cc: Likewise.
	* testsuite/experimental/string_view/inserters/wchar_t/2.cc:
	Likewise.
	* testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc: Likewise.

From-SVN: r264022
2018-08-31 15:09:47 -04:00
Jonathan Wakely 3eb1eda1c8 Fix testsuite failures for __gnu_debug::string with old ABI
The __gnu_debug string (mostly) implements the C++11 API, but when it
wraps the old COW string many of the member functions in the base class
have the wrong parameter types or return types. This makes the
__gnu_debug::string type adapt itself to the base class API. This
actually makes the debug string slightly more conforming than the
underlying string type when using the old ABI.

	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::__const_iterator): Change access to protected.
	[!_GLIBCXX_USE_CXX11_ABI] (basic_string::__const_iterator): Define
	as typedef for iterator.
	* include/debug/string (__const_iterator): Use typedef from base.
	(insert(const_iterator, _CharT))
	(replace(const_iterator, const_iterator, const basic_string&))
	(replace(const_iterator, const_iterator, const _CharT*, size_type))
	(replace(const_iterator, const_iterator, const CharT*))
	(replace(const_iterator, const_iterator, size_type, _CharT))
	(replace(const_iterator, const_iterator, _InputIter, _InputIter))
	(replace(const_iterator, const_iterator, initializer_list<_CharT>)):
	Change const_iterator parameters to __const_iterator.
	(insert(iterator, size_type, _CharT)): Add C++98 overload.
	(insert(const_iterator, _InputIterator, _InputIterator)): Change
	const_iterator parameter to __const_iterator.
	[!_GLIBCXX_USE_CXX11_ABI]: Add workaround for incorrect return type
	of base's member function.
	(insert(const_iterator, size_type, _CharT)) [!_GLIBCXX_USE_CXX11_ABI]:
	Likewise.
	(insert(const_iterator, initializer_list<_CharT>))
	[!_GLIBCXX_USE_CXX11_ABI]: Likewise.
	* testsuite/21_strings/basic_string/init-list.cc: Remove effective
	target directive.

From-SVN: r263808
2018-08-23 11:51:52 +01:00
Jonathan Wakely 75224273c3 Skip tests that depend on the cxx11 std::string
* testsuite/21_strings/basic_string/init-list.cc:
	Require cxx11-abi.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
	Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	Likewise.

From-SVN: r263800
2018-08-23 09:26:16 +01:00
Jonathan Wakely 1bc7a28f94 PR libstdc++/87061 remove pmr type aliases for COW strings
The pmr aliases for basic_string and match_results are incompatible with
the gcc4-compatible ABI because the Copy-On-Write basic_string class
doesn't support C++11 allocators.

	PR libstdc++/87061
	* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::match_results, experimental::pmr::cmatch)
	(experimental::pmr::smatch, experimental::pmr::wcmatch)
	(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
	because COW strings don't support C++11 allocator model.
	* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::basic_string, experimental::pmr::string)
	(experimental::pmr::u16string, experimental::pmr::u32string)
	(experimental::pmr::wstring): Likewise.
	* include/std/regex [!_GLIBCXX_USE_CXX11_ABI] (pmr::match_results)
	(pmr::cmatch, pmr::smatch, pmr::wcmatch, pmr::wsmatch): Likewise.
	* include/std/string [!_GLIBCXX_USE_CXX11_ABI] (pmr::basic_string)
	(pmr::string, pmr::u16string, pmr::u32string, pmr::wstring): Likewise.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Require
	cxx11-abi.
	* testsuite/28_regex/match_results/pmr_typedefs.cc: Likewise.

From-SVN: r263791
2018-08-22 23:54:33 +01:00
Jonathan Wakely 1fc9d0b0e4 Define aliases for containers using polymorphic_allocator
These aliases are placed in the top-level header, e.g. <vector> not
<bits/stl_vector.h>. This ensures that they refer to whichever of
std::vector or __debug::vector or __profile::vector is in use when the
header is included.

	* include/std/deque (std::pmr::deque): Declare alias.
	* include/std/forward_list (std::pmr::forward_list): Likewise.
	* include/std/list (std::pmr::list): Likewise.
	* include/std/map (std::pmr::map, std::pmr::multimap): Likewise.
	* include/std/regex (std::pmr::match_results, std::pmr::cmatch)
	(std::pmr::smatch, std::pmr::wcmatch, std::pmr::wsmatch): Likewise.
	* include/std/set (std::pmr::set, std::pmr::multiset): Likewise.
	* include/std/string (std::pmr::basic_string, std::pmr::string)
	(std::pmr::u16string, std::pmr::u32string, std::pmr::wstring):
	Likewise.
	* include/std/unordered_map (std::pmr::unordered_map)
	(std::pmr::unordered_multimap): Likewise.
	* include/std/unordered_set (std::pmr::unordered_set)
	(std::pmr::unordered_multiset): Likewise.
	* include/std/vector (std::pmr::vector): Likewise.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: New test.
	* testsuite/23_containers/deque/types/pmr_typedefs.cc: New test.
	* testsuite/23_containers/forward_list/pmr_typedefs.cc: New test.
	* testsuite/23_containers/list/pmr_typedefs.cc: New test.
	* testsuite/23_containers/map/pmr_typedefs.cc: New test.
	* testsuite/23_containers/multimap/pmr_typedefs.cc: New test.
	* testsuite/23_containers/multiset/pmr_typedefs.cc: New test.
	* testsuite/23_containers/set/pmr_typedefs.cc: New test.
	* testsuite/23_containers/unordered_map/pmr_typedefs.cc: New test.
	* testsuite/23_containers/unordered_multimap/pmr_typedefs.cc: New
	test.
	* testsuite/23_containers/unordered_multiset/pmr_typedefs.cc: New
	test.
	* testsuite/23_containers/unordered_set/pmr_typedefs.cc: New test.
	* testsuite/23_containers/vector/pmr_typedefs.cc: New test.
	* testsuite/28_regex/match_results/pmr_typedefs.cc: New test.

From-SVN: r263456
2018-08-10 00:25:53 +01:00
Jonathan Wakely 2b69e93cd1 Remove dg-require-cstdint directive from tests
Tests for components which are no longer dependent on
_GLIBCXX_USE_C99_STDINT_TR1 do not need to require <cstdint>.

	* testsuite/18_support/numeric_limits/char16_32_t.cc: Qualify names
	from namespace std.
	* testsuite/20_util/align/2.cc: Remove dg-require-cstdint directive.
	* testsuite/20_util/duration/arithmetic/1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/2.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/dr2020.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/dr934-1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/dr934-2.cc: Likewise.
	* testsuite/20_util/duration/comparison_operators/1.cc: Likewise.
	* testsuite/20_util/duration/cons/1.cc: Likewise.
	* testsuite/20_util/duration/cons/1_neg.cc: Likewise.
	* testsuite/20_util/duration/cons/2.cc: Likewise.
	* testsuite/20_util/duration/cons/54025.cc: Likewise.
	* testsuite/20_util/duration/cons/dr974_neg.cc: Likewise.
	* testsuite/20_util/duration/requirements/explicit_instantiation/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs-4.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp1.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp2.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp3.cc: Likewise.
	* testsuite/20_util/ratio/cons/cons1.cc: Likewise.
	* testsuite/20_util/ratio/operations/45866.cc: Likewise.
	* testsuite/20_util/ratio/operations/47913.cc: Likewise.
	* testsuite/20_util/ratio/operations/53840.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops1.cc: Likewise.
	* testsuite/20_util/shared_ptr/atomic/3.cc: Likewise.
	* testsuite/20_util/system_clock/1.cc: Likewise.
	* testsuite/20_util/time_point/1.cc: Likewise.
	* testsuite/20_util/time_point/2.cc: Likewise.
	* testsuite/20_util/time_point/3.cc: Likewise.
	* testsuite/20_util/time_point/requirements/explicit_instantiation/
	explicit_instantiation.cc: Likewise.
	* testsuite/21_strings/basic_string/requirements/
	explicit_instantiation/char16_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string/requirements/
	explicit_instantiation/char32_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/requirements/
	explicit_instantiation/char16_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/requirements/
	explicit_instantiation/char32_t/1.cc: Likewise.
	* testsuite/21_strings/char_traits/requirements/
	explicit_instantiation/char16_t/1.cc: Likewise.
	* testsuite/21_strings/char_traits/requirements/
	explicit_instantiation/char32_t/1.cc: Likewise.
	* testsuite/21_strings/headers/string/types_std_c++0x.cc: Likewise.
	* testsuite/22_locale/codecvt/char16_t.cc: Likewise.
	* testsuite/22_locale/codecvt/char32_t.cc: Likewise.
	* testsuite/22_locale/codecvt/codecvt_utf16/requirements/1.cc:
	Likewise.
	* testsuite/22_locale/codecvt/codecvt_utf8/requirements/1.cc:
	Likewise.
	* testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc:
	Likewise.
	* testsuite/22_locale/codecvt/utf8.cc: Likewise.
	* testsuite/23_containers/vector/bool/72847.cc: Likewise.
	* testsuite/23_containers/vector/debug/multithreaded_swap.cc:
	Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char16_t/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char32_t/1.cc: Likewise.
	* testsuite/ext/vstring/requirements/explicit_instantiation/char16_t/
	1.cc: Likewise.
	* testsuite/ext/vstring/requirements/explicit_instantiation/char32_t/
	1.cc: Likewise.

From-SVN: r263005
2018-07-26 15:02:26 +01:00
François Dumont 1e736a9531 functions.h (__gnu_debug::__check_string): Move...
2018-07-06  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/functions.h (__gnu_debug::__check_string): Move...
	* include/debug/string (__gnu_debug::__check_string): ... here.
	(_GLIBCXX_DEBUG_VERIFY_STR_COND_AT): New.
	(__glibcxx_check_string_n_constructor): New.
	(__gnu_debug::basic_string<>(const _CharT*, size_type, const _Alloc&)):
	Use latter.
	(__glibcxx_check_string_constructor): New.
	(__gnu_debug::basic_string<>(const _CharT*, const _Alloc&)):
	Use latter.
	* testsuite/21_strings/basic_string/debug/1_neg.cc: New.
	* testsuite/21_strings/basic_string/debug/2_neg.cc: New.

From-SVN: r262480
2018-07-06 17:02:33 +00:00
Jonathan Wakely 339657d2d3 Add xfail-if to some tests that fail with COW strings
These tests fail when run with -D_GLIBCXX_USE_CXX11_ABI=0

	* testsuite/21_strings/basic_string/cons/char/deduction.cc: XFAIL for
	COW strings.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.
	* testsuite/21_strings/basic_string/requirements/
	explicit_instantiation/debug.cc: Likewise.

From-SVN: r262448
2018-07-05 18:03:14 +01:00
Jonathan Wakely 30236791e0 PR libstdc++/58265 add noexcept to basic_string::assign(basic_string&&)
PR libstdc++/58265
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::assign(basic_string&&)): Add conditional noexcept
	depending on the allocator's is_always_equal property (LWG 2063).
	* testsuite/21_strings/basic_string/modifiers/assign/char/
	move_assign.cc: Check for non-throwing exception specification.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
	move_assign.cc: Likewise.

From-SVN: r262447
2018-07-05 18:03:05 +01:00
Jonathan Wakely d8d9b83b33 PR libstdc++/58265 implement LWG 2063 for COW strings
For COW strings the default constructor does not allocate when
_GLIBCXX_FULLY_DYNAMIC_STRING == 0, so can be noexcept. The move
constructor and swap do not allocate when the allocators are equal, so
add conditional noexcept using allocator_traits::is_always_equal.

	PR libstdc++/58265
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	[_GLIBCXX_FULLY_DYNAMIC_STRING==0] (basic_string::basic_string()):
	Add GLIBCXX_NOEXCEPT.
	(basic_string::operator=(basic_string&&)): Add _GLIBCXX_NOEXCEPT_IF
	to depend on the allocator's is_always_equal property (LWG 2063).
	(basic_string::swap(basic_string&)): Likewise.
	* include/bits/basic_string.tcc [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::swap(basic_string&)): Likewise.
	* testsuite/21_strings/basic_string/allocator/char/move_assign.cc:
	Check is_nothrow_move_assignable.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Check is_nothrow_move_assignable.
	* testsuite/21_strings/basic_string/cons/char/
	noexcept_move_construct.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/
	noexcept_move_construct.cc: Likewise.

From-SVN: r262443
2018-07-05 16:56:06 +01:00
François Dumont 96eb9df619 re PR libstdc++/86272 (__gnu_debug::string uses undefined __glibcxx_check_insert_range2)
2018-07-04  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/86272
	* include/debug/string
	(__gnu_debug::basic_string<>::insert<_Ite>(const_iterator, _Ite, _Ite)):
	Use __glibcxx_check_insert_range.
	* 21_strings/basic_string/cons/char/1.cc: Adapt test to use
	__gnu_debug::string when _GLIBCXX_DEBUG.
	* 21_strings/basic_string/init-list.cc: Likewise.
	* 21_strings/basic_string/modifiers/insert/char/1.cc: Likewise.
	* 21_strings/basic_string/modifiers/insert/char/2.cc: Likewise.
	* 21_strings/basic_string/modifiers/insert/char/83328.cc: Likewise.
	* 21_strings/basic_string/types/1.cc: Likewise.

From-SVN: r262417
2018-07-04 18:13:11 +00:00
Jonathan Wakely d72888d340 PR libstdc++/86138 prevent implicit instantiation of COW empty rep
The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

	PR libstdc++/86138
	* include/bits/basic_string.tcc:
	[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
	(basic_string<char>::_Rep::_S_empty_rep_storage)
	(basic_string<wchar_t>::_Rep::_S_empty_rep_storage): Add explicit
	instantiation declarations.
	[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
	explicit instantiation declarations.
	* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
	* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

From-SVN: r261873
2018-06-22 00:29:01 +01:00
Jonathan Wakely cda121ac7a PR libstdc++/83328 add correct basic_string::insert for initializer_list
The SSO basic_string has a non-standard insert(iterator, initializer_list)
overload, from a C++0x draft. This adds the correct overload, while also
preserving the old one so that the old symbol is still exported from the
library.

The COW basic_string doesn't have any of the C++11 changes to the insert
overloads (they all still have non-const iterator parameters and the
ones that should return an iterator still return void). This doesn't
make any change to the COW string.

	PR libstdc++/83328
	* acinclude.m4 (libtool_VERSION): Bump to 6:26:0.
	* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.26 and export new symbol.
	* configure: Regenerate.
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::insert(const_iterator, initializer_list<C>)): Add.
	[_GLIBCXX_USE_CXX11_ABI && !_GLIBCXX_DEFINING_STRING_INSTANTIATIONS]
	(basic_string::insert(iterator, initializer_list<C>)): Suppress
	definition.
	* include/debug/string (basic_string::insert(iterator, C)): Change
	first parameter to const_iterator.
	(basic_string::insert(iterator, size_type, C)): Likewise. Change
	return type to iterator.
	(basic_string::insert(iterator, InputIterator, InputIterator)):
	Likewise.
	(basic_string::insert(iterator, initializer_list<C>)): Change first
	parameter to const_iterator and return type to iterator.
	* src/c++11/string-inst.cc: Extend comment.
	* testsuite/21_strings/basic_string/modifiers/insert/char/83328.cc:
	New.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/83328.cc:
	New.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r261866
2018-06-21 23:01:25 +01:00
Jonathan Wakely 5d84e6c53e LWG 3076 basic_string CTAD ambiguity
When deduction guides are supported by the compiler (i.e. for C++17 and
later) replace two basic_string constructors by constrained function
templates as required by LWG 3075. In order to ensure that the pre-C++17
non-template constructors are still exported from the shared library
define a macro in src/c++11/string-inst.cc to force the non-template
declarations (this isn't strictly needed yet, because the string
instantiations are compiled with -std=gnu++11, but that is likely to
change).

	LWG 3076 basic_string CTAD ambiguity
	* doc/xml/manual/intro.xml: Document LWG 3076 change.
	* include/bits/basic_string.h
	[__cpp_deduction_guides && !_GLIBCXX_DEFINING_STRING_INSTANTIATIONS]
	(basic_string(const _CharT*, const _Alloc&)): Turn into a function
	template constrained by _RequireAllocator.
	(basic_string(size_type, _CharT, const _Alloc&)): Likewise.
	* src/c++11/string-inst.cc (_GLIBCXX_DEFINING_STRING_INSTANTIATIONS):
	Define.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc: Test
	deduction
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.

From-SVN: r261670
2018-06-16 00:47:33 +01:00
Jonathan Wakely 525d67d42f PR libstdc++/86169 unshare COW string when non-const data() called
PR libstdc++/86169
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::data()): Unshare string.
	* testsuite/21_strings/basic_string/operations/data/char/86169.cc:
	New.

From-SVN: r261642
2018-06-15 19:47:29 +01:00
Jonathan Wakely 53e926c8cd LWG 3075 basic_string needs deduction guides from basic_string_view
* testsuite/21_strings/basic_string/cons/char/deduction.cc: Test
	deduction from string views.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.

From-SVN: r261612
2018-06-14 21:27:04 +01:00
Jonathan Wakely 852ee53c27 PR libstdc++/84087 add default arguments to basic_string members (LWG 2268)
This change was a DR against C++11 and so should have been implemented
years ago.

	PR libstdc++/84087 LWG DR 2268 basic_string default arguments
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI=1]
	(append(const basic_string&, size_type, size_type)
	(assign(const basic_string&, size_type, size_type)
	(insert(size_type, const basic_string&, size_type, size_type)
	(replace(size_type,size_type,const basic_string&,size_type,size_type)
	(compare(size_type,size_type,constbasic_string&,size_type,size_type)):
	Add default arguments (LWG 2268).
	[_GLIBCXX_USE_CXX11_ABI=0]
	(append(const basic_string&, size_type, size_type)
	(assign(const basic_string&, size_type, size_type)
	(insert(size_type, const basic_string&, size_type, size_type)
	(replace(size_type,size_type,const basic_string&,size_type,size_type)
	(compare(size_type,size_type,constbasic_string&,size_type,size_type)):
	Likewise.
	* testsuite/21_strings/basic_string/dr2268.cc: New test.

From-SVN: r259895
2018-05-03 16:01:20 +01:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jonathan Wakely 4f9621392f PR libstdc++/83450 avoid -Wreturn-type warning in test
PR libstdc++/83450
	* testsuite/21_strings/basic_string/pthread18185.cc: Add return
	statement.

From-SVN: r255992
2017-12-24 09:17:38 +00:00
Jonathan Wakely 4cf5930fdc PR libstdc++/79162 Fix std::string regression due to LWG 2946
PR libstdc++/79162
	* include/bits/basic_string.h (basic_string::_If_sv): Remove from the
	overload set when the argument is derived from basic_string.
	* testsuite/21_strings/basic_string/cons/char/moveable2_c++17.cc: New
	test.
	* testsuite/21_strings/basic_string/cons/wchar_t/moveable2_c++17.cc:
	New test.

From-SVN: r253024
2017-09-20 18:59:50 +01:00
Jakub Jelinek 7b9361409d invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated.
* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
	c++1z and gnu++1z as deprecated.  Change other references to
	-std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17.
	Change -Wc++1z-compat to -Wc++17-compat.
	* doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L.
	* dwarf2out.c (highest_c_language): Handle C++17.
	(gen_compile_unit_die): Likewise.
c-family/
	* c.opt (Wc++1z-compat): Change from option to undocumented alias.
	(Wc++17-compat): Change from undocumented alias to option.
	(Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat,
	change C++1z to C++17 in description.
	(std=c++1z, std=gnu++1z): Change from option to undocumented
	deprecated alias.
	(std=c++17, std=gnu++17): Change from undocumented alias to option.
	Adjust description.
	* c-common.h (enum cxx_dialect): Rename cxx1z to cxx17.
	* c-opts.c (set_std_cxx1z): Rename to ...
	(set_std_cxx17): ... this.
	(c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17
	and OPT_std_gnu__1z to OPT_std_gnu__17.  Adjust set_std_cxx1z
	caller.  
	(c_common_post_options): Use cxx17 instead of cxx1z.  Adjust
	comments.
cp/
	* decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
	adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
	to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
	(cxx_init_decl_processing, next_initializable_field,
	is_direct_enum_init, check_initializer, cp_finish_decl,
	mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
	finish_function): Likewise.
	* cp-tree.h (DECL_INLINE_VAR_P): Likewise.
	* pt.c (mark_template_parm, convert_nontype_argument,
	instantiate_class_template_1, type_unification_real, unify,
	get_partial_spec_bindings, dependent_type_p_r): Likewise.
	* typeck.c (cp_build_unary_op): Likewise.
	* constexpr.c (var_in_maybe_constexpr_fn): Likewise.
	* call.c (build_user_type_conversion_1, build_over_call,
	build_special_member_call): Likewise.
	* lambda.c (begin_lambda_type): Likewise.
	* typeck2.c (process_init_constructor_record): Likewise.
	* class.c (build_base_field, finalize_literal_type_property,
	explain_non_literal_class): Likewise.
	* parser.c (cp_parser_diagnose_invalid_type_name,
	cp_parser_primary_expression, cp_parser_lambda_introducer,
	cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
	cp_convert_range_for, cp_parser_perform_range_for_lookup,
	cp_parser_decomposition_declaration, cp_parser_linkage_specification,
	cp_parser_static_assert, cp_parser_simple_type_specifier,
	cp_parser_namespace_definition, cp_parser_using_declaration,
	cp_parser_init_declarator, cp_parser_type_parameter_key,
	cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
	cp_parser_constructor_declarator_p): Likewise.
	* mangle.c (struct globals): Rename need_cxx1z_warning to
	need_cxx17_warning.
	(write_exception_spec, start_mangling, mangle_decl): Likewise.
	* Make-lang.in (check-c++1z): Rename to check-c++17, depend on
	it.
	(check-c++17): New goal.  Use 17 instead of 1z.
	(check-c++-all): Use 17 instead of 1z.
testsuite/
	* lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z.
	* lib/target-supports.exp (check_effective_target_c++14): Use
	check_effective_target_c++17 instead of check_effective_target_c++1z.
	(check_effective_target_c++14_down): Likewise.
	(check_effective_target_c++1z_only): Rename to ...
	(check_effective_target_c++17_only): ... this.
	(check_effective_target_c++1z): Rename to ...
	(check_effective_target_c++17): ... this.
	* g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17
	instead of -std=c++1z or -std=gnu++1z.  Use c++17 instead of c++1z
	and c++17_only instead of c++1z_only.  Adjust expected diagnostics
	and comments refering to 1z to 17.
	* g++.dg/debug/dwarf2/inline-var-2.C: Likewise.
	* g++.dg/template/partial5.C: Likewise.
	* g++.dg/template/nontype8.C: Likewise.
	* g++.dg/cpp1z/noexcept-type5.C: Likewise.
	* g++.dg/cpp1z/nontype3a.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda4.C: Likewise.
	* g++.dg/cpp1z/noexcept-type16.C: Likewise.
	* g++.dg/cpp1z/class-deduction32.C: Likewise.
	* g++.dg/cpp1z/pr78771.C: Likewise.
	* g++.dg/cpp1z/elide1.C: Likewise.
	* g++.dg/cpp1z/fold3.C: Likewise.
	* g++.dg/cpp1z/class-deduction2.C: Likewise.
	* g++.dg/cpp1z/noexcept-type12.C: Likewise.
	* g++.dg/cpp1z/inline-var2.C: Likewise.
	* g++.dg/cpp1z/eval-order2.C: Likewise.
	* g++.dg/cpp1z/decomp21.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda9.C: Likewise.
	* g++.dg/cpp1z/utf8-neg.C: Likewise.
	* g++.dg/cpp1z/class-deduction41.C: Likewise.
	* g++.dg/cpp1z/class-deduction23.C: Likewise.
	* g++.dg/cpp1z/nodiscard3.C: Likewise.
	* g++.dg/cpp1z/static_assert-nomsg.C: Likewise.
	* g++.dg/cpp1z/noexcept-type9.C: Likewise.
	* g++.dg/cpp1z/class-deduction21.C: Likewise.
	* g++.dg/cpp1z/range-for1.C: Likewise.
	* g++.dg/cpp1z/init-statement4.C: Likewise.
	* g++.dg/cpp1z/udlit-utf8char.C: Likewise.
	* g++.dg/cpp1z/decomp30.C: Likewise.
	* g++.dg/cpp1z/class-deduction39.C: Likewise.
	* g++.dg/cpp1z/register2.C: Likewise.
	* g++.dg/cpp1z/decomp9.C: Likewise.
	* g++.dg/cpp1z/regress1.C: Likewise.
	* g++.dg/cpp1z/direct-enum-init1.C: Likewise.
	* g++.dg/cpp1z/class-deduction30.C: Likewise.
	* g++.dg/cpp1z/abbrev2.C: Likewise.
	* g++.dg/cpp1z/nontype-auto6.C: Likewise.
	* g++.dg/cpp1z/regress2.C: Likewise.
	* g++.dg/cpp1z/decomp16.C: Likewise.
	* g++.dg/cpp1z/bool-increment1.C: Likewise.
	* g++.dg/cpp1z/aligned-new1.C: Likewise.
	* g++.dg/cpp1z/decomp3.C: Likewise.
	* g++.dg/cpp1z/register1.C: Likewise.
	* g++.dg/cpp1z/namespace-attribs.C: Likewise.
	* g++.dg/cpp1z/class-deduction1.C: Likewise.
	* g++.dg/cpp1z/decomp10.C: Likewise.
	* g++.dg/cpp1z/constexpr-if11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda10.C: Likewise.
	* g++.dg/cpp1z/decomp27.C: Likewise.
	* g++.dg/cpp1z/noexcept-type2.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
	* g++.dg/cpp1z/class-deduction9.C: Likewise.
	* g++.dg/cpp1z/attributes-enum-1.C: Likewise.
	* g++.dg/cpp1z/decomp11.C: Likewise.
	* g++.dg/cpp1z/aligned-new3.C: Likewise.
	* g++.dg/cpp1z/utf8-2.C: Likewise.
	* g++.dg/cpp1z/lambda-this3.C: Likewise.
	* g++.dg/cpp1z/decomp-constexpr1.C: Likewise.
	* g++.dg/cpp1z/byte1.C: Likewise.
	* g++.dg/cpp1z/nontype-auto9.C: Likewise.
	* g++.dg/cpp1z/aggr-base4.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda1.C: Likewise.
	* g++.dg/cpp1z/nontype-auto3.C: Likewise.
	* g++.dg/cpp1z/utf8-2a.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda7.C: Likewise.
	* g++.dg/cpp1z/aggr-base6.C: Likewise.
	* g++.dg/cpp1z/cplusplus.C: Likewise.
	* g++.dg/cpp1z/class-deduction20.C: Likewise.
	* g++.dg/cpp1z/aggr-base2.C: Likewise.
	* g++.dg/cpp1z/class-deduction6.C: Likewise.
	* g++.dg/cpp1z/noexcept-type3.C: Likewise.
	* g++.dg/cpp1z/class-deduction31.C: Likewise.
	* g++.dg/cpp1z/class-deduction25.C: Likewise.
	* g++.dg/cpp1z/class-deduction18.C: Likewise.
	* g++.dg/cpp1z/fold9.C: Likewise.
	* g++.dg/cpp1z/noexcept-type8.C: Likewise.
	* g++.dg/cpp1z/abbrev1.C: Likewise.
	* g++.dg/cpp1z/constexpr-if10.C: Likewise.
	* g++.dg/cpp1z/utf8.C: Likewise.
	* g++.dg/cpp1z/noexcept-type7.C: Likewise.
	* g++.dg/cpp1z/aggr-base3.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
	* g++.dg/cpp1z/init-statement2.C: Likewise.
	* g++.dg/cpp1z/nontype-auto4.C: Likewise.
	* g++.dg/cpp1z/constexpr-if12.C: Likewise.
	* g++.dg/cpp1z/class-deduction40.C: Likewise.
	* g++.dg/cpp1z/nontype3.C: Likewise.
	* g++.dg/cpp1z/class-deduction14.C: Likewise.
	* g++.dg/cpp1z/fold7.C: Likewise.
	* g++.dg/cpp1z/nontype2.C: Likewise.
	* g++.dg/cpp1z/class-deduction15.C: Likewise.
	* g++.dg/cpp1z/nested-namespace-def1.C: Likewise.
	* g++.dg/cpp1z/class-deduction13.C: Likewise.
	* g++.dg/cpp1z/aligned-new7.C: Likewise.
	* g++.dg/cpp1z/noexcept-type1.C: Likewise.
	* g++.dg/cpp1z/nontype1.C: Likewise.
	* g++.dg/cpp1z/init-statement5.C: Likewise.
	* g++.dg/cpp1z/nontype-auto2.C: Likewise.
	* g++.dg/cpp1z/decomp17.C: Likewise.
	* g++.dg/cpp1z/fold4.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda2.C: Likewise.
	* g++.dg/cpp1z/fold7a.C: Likewise.
	* g++.dg/cpp1z/nontype-auto5.C: Likewise.
	* g++.dg/cpp1z/init-statement7.C: Likewise.
	* g++.dg/cpp1z/aggr-base5.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda5.C: Likewise.
	* g++.dg/cpp1z/pr79143.C: Likewise.
	* g++.dg/cpp1z/class-deduction38.C: Likewise.
	* g++.dg/cpp1z/nontype-auto8.C: Likewise.
	* g++.dg/cpp1z/class-deduction12.C: Likewise.
	* g++.dg/cpp1z/decomp20.C: Likewise.
	* g++.dg/cpp1z/class-deduction22.C: Likewise.
	* g++.dg/cpp1z/class-deduction29.C: Likewise.
	* g++.dg/cpp1z/class-deduction8.C: Likewise.
	* g++.dg/cpp1z/class-deduction43.C: Likewise.
	* g++.dg/cpp1z/feat-cxx1z.C: Likewise.
	* g++.dg/cpp1z/fold8.C: Likewise.
	* g++.dg/cpp1z/init-statement3.C: Likewise.
	* g++.dg/cpp1z/nontype-auto10.C: Likewise.
	* g++.dg/cpp1z/class-deduction36.C: Likewise.
	* g++.dg/cpp1z/noexcept-type17.C: Likewise.
	* g++.dg/cpp1z/fallthrough1.C: Likewise.
	* g++.dg/cpp1z/fold1.C: Likewise.
	* g++.dg/cpp1z/class-deduction26.C: Likewise.
	* g++.dg/cpp1z/fold-ice1.C: Likewise.
	* g++.dg/cpp1z/fold5.C: Likewise.
	* g++.dg/cpp1z/class-deduction34.C: Likewise.
	* g++.dg/cpp1z/noexcept-type6.C: Likewise.
	* g++.dg/cpp1z/class-deduction7.C: Likewise.
	* g++.dg/cpp1z/class-deduction16.C: Likewise.
	* g++.dg/cpp1z/class-deduction10.C: Likewise.
	* g++.dg/cpp1z/eval-order3.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda13.C: Likewise.
	* g++.dg/cpp1z/aggr-base2a.C: Likewise.
	* g++.dg/cpp1z/nontype-auto1.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda3.C: Likewise.
	* g++.dg/cpp1z/nontype-auto7.C: Likewise.
	* g++.dg/cpp1z/decomp15.C: Likewise.
	* g++.dg/cpp1z/noexcept-type4.C: Likewise.
	* g++.dg/cpp1z/fold-mangle.C: Likewise.
	* g++.dg/cpp1z/class-deduction35.C: Likewise.
	* g++.dg/cpp1z/decomp4.C: Likewise.
	* g++.dg/cpp1z/class-deduction42.C: Likewise.
	* g++.dg/cpp1z/init-statement8.C: Likewise.
	* g++.dg/cpp1z/inline-var1a.C: Likewise.
	* g++.dg/cpp1z/init-statement6.C: Likewise.
	* g++.dg/cpp1z/class-deduction17.C: Likewise.
	* g++.dg/cpp1z/class-deduction28.C: Likewise.
	* g++.dg/cpp1z/class-deduction27.C: Likewise.
	* g++.dg/cpp1z/decomp-bitfield1.C: Likewise.
	* g++.dg/cpp1z/attributes-enum-1a.C: Likewise.
	* g++.dg/cpp1z/class-deduction11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda12.C: Likewise.
	* g++.dg/cpp1z/init-statement9.C: Likewise.
	* g++.dg/cpp1z/class-deduction19.C: Likewise.
	* g++.dg/cpp1z/class-deduction5.C: Likewise.
	* g++.dg/cpp1z/fold2.C: Likewise.
	* g++.dg/cpp1z/class-deduction33.C: Likewise.
	* g++.dg/cpp1z/class-deduction24.C: Likewise.
	* g++.dg/cpp1z/aggr-base1.C: Likewise.
	* g++.dg/cpp1z/fold6.C: Likewise.
	* g++.dg/cpp1z/decomp12.C: Likewise.
	* g++.dg/cpp1z/class-deduction4.C: Likewise.
	* g++.dg/cpp1z/inline-var1.C: Likewise.
	* g++.dg/cpp1z/aligned-new2.C: Likewise.
	* g++.dg/cpp1z/class-deduction3.C: Likewise.
	* g++.dg/other/error3.C: Likewise.
	* g++.dg/init/new25.C: Likewise.
	* g++.dg/init/new13.C: Likewise.
	* g++.dg/tls/diag-2.C: Likewise.
	* g++.dg/tls/diag-4.C: Likewise.
	* g++.dg/opt/noreturn-1.C: Likewise.
	* g++.dg/eh/async-unwind2.C: Likewise.
	* g++.dg/eh/spec9.C: Likewise.
	* g++.dg/eh/spec7.C: Likewise.
	* g++.dg/eh/template1.C: Likewise.
	* g++.dg/eh/cond4.C: Likewise.
	* g++.dg/eh/pr41819.C: Likewise.
	* g++.dg/eh/delete1.C: Likewise.
	* g++.dg/eh/spec3.C: Likewise.
	* g++.dg/eh/forced4.C: Likewise.
	* g++.dg/eh/spec2.C: Likewise.
	* g++.dg/eh/shadow1.C: Likewise.
	* g++.dg/eh/pr38662.C: Likewise.
	* g++.dg/eh/ehopt1.C: Likewise.
	* g++.dg/eh/spec8.C: Likewise.
	* g++.dg/eh/init-temp2.C: Likewise.
	* g++.dg/rtti/crash3.C: Likewise.
	* g++.dg/warn/Wreturn-type-3.C: Likewise.
	* g++.dg/warn/register-parm-1.C: Likewise.
	* g++.dg/warn/register-var-2.C: Likewise.
	* g++.dg/gcov/gcov-7.C: Likewise.
	* g++.dg/tree-ssa/pr45605.C: Likewise.
	* g++.dg/cpp/pr23827_cxx98_neg.C: Likewise.
	* g++.dg/lookup/exception1.C: Likewise.
	* g++.dg/ubsan/pr79589.C: Likewise.
	* g++.dg/tm/pr47340.C: Likewise.
	* g++.dg/tm/pr46567.C: Likewise.
	* g++.dg/expr/bitfield5.C: Likewise.
	* g++.dg/expr/bool1.C: Likewise.
	* g++.dg/expr/lval3.C: Likewise.
	* g++.dg/expr/lval4.C: Likewise.
	* g++.dg/expr/bitfield4.C: Likewise.
	* g++.dg/expr/bitfield6.C: Likewise.
	* g++.dg/expr/bool3.C: Likewise.
	* g++.dg/ext/has_nothrow_constructor.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-1.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-2.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
	* g++.dg/ext/has_nothrow_assign.C: Likewise.
	* g++.dg/parse/register1.C: Likewise.
	* g++.dg/parse/error15.C: Likewise.
	* g++.dg/parse/linkage2.C: Likewise.
	* g++.dg/concepts/intro2.C: Likewise.
	* g++.dg/concepts/class.C: Likewise.
	* g++.dg/concepts/traits1.C: Likewise.
	* g++.dg/concepts/req5.C: Likewise.
	* g++.dg/concepts/var-concept5.C: Likewise.
	* g++.dg/concepts/fn-concept2.C: Likewise.
	* g++.dg/concepts/traits2.C: Likewise.
	* g++.dg/concepts/placeholder2.C: Likewise.
	* g++.dg/concepts/class6.C: Likewise.
	* g++.dg/concepts/memtmpl1.C: Likewise.
	* g++.dg/concepts/friend2.C: Likewise.
	* g++.dg/concepts/template-parm3.C: Likewise.
	* g++.dg/concepts/template-parm10.C: Likewise.
	* g++.dg/concepts/explicit-spec1.C: Likewise.
	* g++.dg/concepts/explicit-spec3.C: Likewise.
	* g++.dg/concepts/var-templ2.C: Likewise.
	* g++.dg/concepts/intro5.C: Likewise.
	* g++.dg/concepts/deduction-constraint1.C: Likewise.
	* g++.dg/concepts/iconv1.C: Likewise.
	* g++.dg/concepts/constrained-parm.C: Likewise.
	* g++.dg/concepts/template-template-parm1.C: Likewise.
	* g++.dg/concepts/var-concept3.C: Likewise.
	* g++.dg/concepts/class3.C: Likewise.
	* g++.dg/concepts/memfun2.C: Likewise.
	* g++.dg/concepts/req1.C: Likewise.
	* g++.dg/concepts/disjunction1.C: Likewise.
	* g++.dg/concepts/req17.C: Likewise.
	* g++.dg/concepts/pr65848.C: Likewise.
	* g++.dg/concepts/placeholder4.C: Likewise.
	* g++.dg/concepts/decl-diagnose.C: Likewise.
	* g++.dg/concepts/intro7.C: Likewise.
	* g++.dg/concepts/pr68683.C: Likewise.
	* g++.dg/concepts/partial-spec4.C: Likewise.
	* g++.dg/concepts/template-parm5.C: Likewise.
	* g++.dg/concepts/explicit-inst1.C: Likewise.
	* g++.dg/concepts/class-deduction1.C: Likewise.
	* g++.dg/concepts/class1.C: Likewise.
	* g++.dg/concepts/req15.C: Likewise.
	* g++.dg/concepts/memfun.C: Likewise.
	* g++.dg/concepts/pr68434.C: Likewise.
	* g++.dg/concepts/inherit-ctor4.C: Likewise.
	* g++.dg/concepts/partial-spec6.C: Likewise.
	* g++.dg/concepts/var-templ1.C: Likewise.
	* g++.dg/concepts/template-parm8.C: Likewise.
	* g++.dg/concepts/explicit-inst3.C: Likewise.
	* g++.dg/concepts/class4.C: Likewise.
	* g++.dg/concepts/req6.C: Likewise.
	* g++.dg/concepts/fn8.C: Likewise.
	* g++.dg/concepts/class5.C: Likewise.
	* g++.dg/concepts/placeholder5.C: Likewise.
	* g++.dg/concepts/req16.C: Likewise.
	* g++.dg/concepts/req10.C: Likewise.
	* g++.dg/concepts/var-concept2.C: Likewise.
	* g++.dg/concepts/auto3.C: Likewise.
	* g++.dg/concepts/generic-fn-err.C: Likewise.
	* g++.dg/concepts/pr65552.C: Likewise.
	* g++.dg/concepts/partial-concept-id2.C: Likewise.
	* g++.dg/concepts/fn1.C: Likewise.
	* g++.dg/concepts/partial-spec.C: Likewise.
	* g++.dg/concepts/template-parm12.C: Likewise.
	* g++.dg/concepts/diagnostic1.C: Likewise.
	* g++.dg/concepts/intro1.C: Likewise.
	* g++.dg/concepts/explicit-inst4.C: Likewise.
	* g++.dg/concepts/req18.C: Likewise.
	* g++.dg/concepts/explicit-spec5.C: Likewise.
	* g++.dg/concepts/var-concept6.C: Likewise.
	* g++.dg/concepts/fn9.C: Likewise.
	* g++.dg/concepts/req2.C: Likewise.
	* g++.dg/concepts/template-parm7.C: Likewise.
	* g++.dg/concepts/req14.C: Likewise.
	* g++.dg/concepts/template-parm6.C: Likewise.
	* g++.dg/concepts/variadic4.C: Likewise.
	* g++.dg/concepts/fn6.C: Likewise.
	* g++.dg/concepts/req-neg1.C: Likewise.
	* g++.dg/concepts/alias3.C: Likewise.
	* g++.dg/concepts/expression2.C: Likewise.
	* g++.dg/concepts/partial-spec3.C: Likewise.
	* g++.dg/concepts/expression3.C: Likewise.
	* g++.dg/concepts/memfun-err.C: Likewise.
	* g++.dg/concepts/pr66091.C: Likewise.
	* g++.dg/concepts/explicit-spec2.C: Likewise.
	* g++.dg/concepts/equiv.C: Likewise.
	* g++.dg/concepts/friend1.C: Likewise.
	* g++.dg/concepts/fn4.C: Likewise.
	* g++.dg/concepts/var-templ3.C: Likewise.
	* g++.dg/concepts/explicit-inst2.C: Likewise.
	* g++.dg/concepts/alias2.C: Likewise.
	* g++.dg/concepts/regress/alias-decl-42.C: Likewise.
	* g++.dg/concepts/placeholder6.C: Likewise.
	* g++.dg/concepts/fn10.C: Likewise.
	* g++.dg/concepts/req3.C: Likewise.
	* g++.dg/concepts/variadic2.C: Likewise.
	* g++.dg/concepts/pr65636.C: Likewise.
	* g++.dg/concepts/intro6.C: Likewise.
	* g++.dg/concepts/class2.C: Likewise.
	* g++.dg/concepts/fn2.C: Likewise.
	* g++.dg/concepts/req20.C: Likewise.
	* g++.dg/concepts/req8.C: Likewise.
	* g++.dg/concepts/placeholder1.C: Likewise.
	* g++.dg/concepts/pr65854.C: Likewise.
	* g++.dg/concepts/member-concept.C: Likewise.
	* g++.dg/concepts/template-parm2.C: Likewise.
	* g++.dg/concepts/variadic1.C: Likewise.
	* g++.dg/concepts/fn7.C: Likewise.
	* g++.dg/concepts/intro4.C: Likewise.
	* g++.dg/concepts/req13.C: Likewise.
	* g++.dg/concepts/inherit-ctor3.C: Likewise.
	* g++.dg/concepts/explicit-spec6.C: Likewise.
	* g++.dg/concepts/auto1.C: Likewise.
	* g++.dg/concepts/alias1.C: Likewise.
	* g++.dg/concepts/fn-concept1.C: Likewise.
	* g++.dg/concepts/template-parm11.C: Likewise.
	* g++.dg/concepts/explicit-spec4.C: Likewise.
	* g++.dg/concepts/partial-concept-id1.C: Likewise.
	* g++.dg/concepts/req9.C: Likewise.
	* g++.dg/concepts/req4.C: Likewise.
	* g++.dg/concepts/pr65681.C: Likewise.
	* g++.dg/concepts/req7.C: Likewise.
	* g++.dg/concepts/req12.C: Likewise.
	* g++.dg/concepts/fn5.C: Likewise.
	* g++.dg/concepts/alias4.C: Likewise.
	* g++.dg/concepts/generic-fn.C: Likewise.
	* g++.dg/concepts/feature-macro.C: Likewise.
	* g++.dg/concepts/req19.C: Likewise.
	* g++.dg/concepts/placeholder3.C: Likewise.
	* g++.dg/concepts/intro3.C: Likewise.
	* g++.dg/concepts/partial-spec5.C: Likewise.
	* g++.dg/concepts/template-parm4.C: Likewise.
	* g++.dg/concepts/dr1430.C: Likewise.
	* g++.dg/concepts/pr65634.C: Likewise.
	* g++.dg/concepts/var-concept4.C: Likewise.
	* g++.dg/concepts/pr67249.C: Likewise.
	* g++.dg/concepts/expression.C: Likewise.
	* g++.dg/concepts/pr65575.C: Likewise.
	* g++.dg/concepts/partial-spec2.C: Likewise.
	* g++.dg/concepts/template-parm9.C: Likewise.
	* g++.dg/concepts/inherit-ctor1.C: Likewise.
	* g++.dg/concepts/equiv2.C: Likewise.
	* g++.dg/concepts/req11.C: Likewise.
	* g++.dg/concepts/template-parm1.C: Likewise.
	* g++.dg/concepts/inherit-ctor2.C: Likewise.
	* g++.dg/concepts/var-concept1.C: Likewise.
	* g++.dg/concepts/fn3.C: Likewise.
	* g++.dg/torture/pr46364.C: Likewise.
	* g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
	* g++.dg/torture/stackalign/eh-global-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
	* g++.dg/torture/pr52918-1.C: Likewise.
	* g++.dg/torture/pr49394.C: Likewise.
	* g++.dg/torture/pr57190.C: Likewise.
	* g++.dg/cpp0x/static_assert8.C: Likewise.
	* g++.dg/cpp0x/noexcept19.C: Likewise.
	* g++.dg/cpp0x/variadic-throw.C: Likewise.
	* g++.dg/cpp0x/variadic73.C: Likewise.
	* g++.dg/cpp0x/noexcept02.C: Likewise.
	* g++.dg/cpp0x/defaulted23.C: Likewise.
	* g++.dg/cpp0x/noexcept08.C: Likewise.
	* g++.dg/cpp0x/auto9.C: Likewise.
	* g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise.
	* g++.dg/cpp0x/error5.C: Likewise.
	* c-c++-common/gomp/atomic-12.c: Likewise.
	* c-c++-common/gomp/atomic-13.c: Likewise.
	* c-c++-common/gomp/atomic-14.c: Likewise.
	* c-c++-common/Wvarargs-2.c: Likewise.
	* c-c++-common/Wvarargs.c: Likewise.
	* c-c++-common/vector-subscript-2.c: Likewise.
	* g++.old-deja/g++.robertl/eb123.C: Likewise.
	* g++.old-deja/g++.eh/tmpl3.C: Likewise.
	* g++.old-deja/g++.eh/cleanup2.C: Likewise.
	* g++.old-deja/g++.eh/badalloc1.C: Likewise.
	* g++.old-deja/g++.eh/throw2.C: Likewise.
	* g++.old-deja/g++.eh/throw1.C: Likewise.
	* g++.old-deja/g++.eh/tmpl1.C: Likewise.
	* g++.old-deja/g++.other/new7.C: Likewise.
	* g++.old-deja/g++.other/crash30.C: Likewise.
	* g++.old-deja/g++.other/regstack.C: Likewise.
	* g++.old-deja/g++.other/crash28.C: Likewise.
	* g++.old-deja/g++.jason/bool5.C: Likewise.
	* g++.old-deja/g++.mike/p10416.C: Likewise.
	* g++.old-deja/g++.mike/eh25.C: Likewise.
	* g++.old-deja/g++.mike/eh55.C: Likewise.
libcpp/
	* include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
	to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
	* init.c (lang_defaults, cpp_init_builtins): Likewise.
	* expr.c (cpp_classify_number): Use C++17 instead of C++1z
	in diagnostics.
libstdc++-v3/
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or
	-std=gnu++17 instead of -std=c++1z or -std=gnu++1z.  Use c++17 instead
	of c++1z and c++17_only instead of c++1z_only.  Adjust expected
	diagnostics and comments refering to 1z to 17.
	* testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise.
	* testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise.
	* testsuite/30_threads/scoped_lock/cons/1.cc: Likewise.
	* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise.
	* testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise.
	* testsuite/18_support/launder/1.cc (test02): Likewise.
	* testsuite/18_support/launder/requirements_neg.cc: Likewise.
	* testsuite/18_support/launder/requirements.cc: Likewise.
	* testsuite/18_support/byte/requirements.cc: Likewise.
	* testsuite/18_support/byte/ops.cc: Likewise.
	* testsuite/18_support/byte/global_neg.cc: Likewise.
	* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
	Likewise.
	* testsuite/27_io/types/4.cc: Likewise.
	* testsuite/25_algorithms/sample/81221.cc: Likewise.
	* testsuite/25_algorithms/sample/1.cc: Likewise.
	* testsuite/25_algorithms/sample/2.cc: Likewise.
	* testsuite/25_algorithms/search/searcher.cc: Likewise.
	* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.
	* testsuite/experimental/filesystem/path/construct/string_view.cc:
	Likewise.
	* testsuite/24_iterators/range_access_cpp17.cc: Likewise.
	* testsuite/24_iterators/container_access.cc: Likewise.
	* testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise.
	* testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/array.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise.
	* testsuite/20_util/pair/cons/deduction.cc: Likewise.
	* testsuite/20_util/variant/deduction.cc: Likewise.
	* testsuite/20_util/tuple/78939.cc: Likewise.
	* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
	* testsuite/20_util/void_t/1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise.
	* testsuite/20_util/addressof/requirements/constexpr.cc: Likewise.
	* testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise.
	* testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/20_util/has_unique_object_representations/value.cc:
	Likewise.
	* testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise.
	* testsuite/20_util/function_objects/invoke/59768.cc: Likewise.
	* testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise.
	* testsuite/20_util/function/cons/deduction.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
	Likewise.
	* testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/20_util/is_aggregate/value.cc: Likewise.
	* testsuite/26_numerics/lcm/1.cc: Likewise.
	* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
	* testsuite/26_numerics/gcd/1.cc: Likewise.
	* testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
	* testsuite/26_numerics/valarray/deduction.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/hypot.cc: Likewise.
	* testsuite/23_containers/queue/members/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/array/cons/deduction.cc: Likewise.
	* testsuite/23_containers/array/cons/deduction_neg.cc: Likewise.
	* testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/deque/cons/deduction.cc: Likewise.
	* testsuite/23_containers/stack/members/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/list/cons/deduction.cc: Likewise.
	* testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/forward_list/cons/deduction.cc: Likewise.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/vector/cons/deduction.cc: Likewise.
	* testsuite/23_containers/vector/bool/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/char/9.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
	Likewise.

From-SVN: r252826
2017-09-15 18:15:46 +02:00
Jonathan Wakely 47d7966a70 Adjust test to pass with old std::string
* testsuite/21_strings/basic_string/lwg2946.cc: Adjust for
	compatibility with old COW std::string.

From-SVN: r251981
2017-09-11 17:54:57 +01:00
Daniel Kruegler df66af3b1e PR libstdc++/79162 implement LWG 2946 and LWG 2758
2017-09-04  Daniel Kruegler  <daniel.kruegler@gmail.com>

	PR libstdc++/79162
	Implement LWG 2946, LWG 2758's resolution missed further corrections
	* include/bits/basic_string.h (basic_string::compare): Add missing
	required noexcept specifications.
	(basic_string): Introduce internal _S_to_string_view and __sv_wrapper
	for implicit string_view conversion.
	(basic_string::basic_string): Fix explicit string_view conversion by
	implicit conversion using _S_to_string_view and __sv_wrapper.
	(basic_string): Introduce internal basic_string(__sv_wrapper, Alloc)
	constructor.
	(basic_string): Fix operator=(T) template by operator=(const T&)
	template for uncopyable types (PR 79162).
	(basic_string::operator+=, basic_string::append, basic_string::assign)
	(basic_string::insert, basic_string::replace, basic_string::find)
	(basic_string::rfind, basic_string::find_first_of)
	(basic_string::find_last_of, basic_string::find_first_not_of)
	(basic_string::find_last_not_of, basic_string::compare): Replace
	__sv_type argument by template const T& (LWG 2946) and correct
	documentation describing __sv_type argument.
	(basic_string::find, basic_string::rfind, basic_string::find_first_of)
	(basic_string::find_last_of, basic_string::find_first_not_of)
	(basic_string::find_last_not_of, basic_string::compare): Replace
	unconditional noexcept specification by conditional noexcept
	specification to partially balance the removal of noexcept by LWG 2946.
	* testsuite/21_strings/basic_string/79162.cc: New.
	* testsuite/21_strings/basic_string/lwg2946.cc: New.

From-SVN: r251664
2017-09-04 16:48:47 +01:00
Rainer Orth 4f4b0ab85f Get rid of dg-skip-if etc. default args
libstdc++-v3:
	* testsuite: Remove dg-skip-if, dg-xfail-if, dg-xfail-run-if
	default args.

	libgomp:
	* testsuite/libgomp.fortran/strassen.f90: Remove dg-skip-if
	default args.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove
	dg-xfail-run-if default args.

	gcc/testsuite:
	Remove dg-skip-if, dg-xfail-if, dg-xfail-run-if default args.

From-SVN: r249339
2017-06-17 15:32:28 +00:00
Jonathan Wakely 4317778a9b PR libstdc++/81092 add std::wstring symbols and bump library version
PR libstdc++/81092
	* acinclude.m4: Bump libtool_VERSION.
	* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/pre/gnu.ver: Add wstring constructor symbols to
	GLIBCXX_3.4.24 version and move random_device::_M_get_entropy() symbol
	to new GLIBCXX_3.4.25 version.
	* doc/xml/manual/abi.xml: Document new versions.
	* doc/html/*: Regenerate.
	* testsuite/21_strings/basic_string/cons/char/8.cc: Use base object
	constructors to ensure required symbols are exported.
	* testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.
	* testsuite/util/testsuite_abi.cc: Add new version.

From-SVN: r249246
2017-06-16 12:54:59 +01:00
Rainer Orth d12366802a Use pthread effective-target in testsuite
* testsuite: Add dg-require-effective-target pthread to -pthread
	tests.
	Remove explicit target lists from dg-do and dg-options.

	* testsuite/30_threads/async/forced_unwind.cc: Remove explit
	target list from dg-options.
	* testsuite/30_threads/packaged_task/forced_unwind.cc: Likewise.

	* 30_threads/shared_mutex/cons/1.cc: Likewise.
	Pass -pthread for all targets.
	* 30_threads/shared_mutex/try_lock/1.cc: Likewise.
	* 30_threads/shared_mutex/try_lock/2.cc: Likewise.
	* 30_threads/shared_mutex/unlock/1.cc: Likewise.

	* testsuite/30_threads/this_thread/57060.cc: Require c++11 via
	dg-require-effective-target.

From-SVN: r249217
2017-06-15 12:18:05 +00:00
Jonathan Wakely cdd17d6e99 Fix libstdc++ testsuite failures with -D_GLIBCXX_USE_CXX11_ABI=0
* doc/xml/manual/test.xml: Correct instructions on running tests.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc: Adjust to
	pass when -D_GLIBCXX_USE_CXX11_ABI=0 added to RUNTESTFLAGS.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.
	* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise.
	* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/char/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/ios_base/storage/2.cc: Likewise.

From-SVN: r249206
2017-06-14 20:38:30 +01:00
Jonathan Wakely 6d82c56288 Add C++17 deduction guide for std::basic_string (P0433R2, partial)
* include/bits/alloc_traits.h (__is_allocator, _RequireAllocator):
	New trait and alias for detecting Allocator-like types.
	* include/bits/basic_string.h (basic_string): Add deduction guide
	from P0433.
	* include/ext/alloc_traits.h (__gnu_cxx::__alloc_traits): Add template
	parameter with default template argument that causes substitution
	failures for types that cannot be allocators.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc: New.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc: New.

From-SVN: r248967
2017-06-07 13:35:08 +01:00
Jonathan Wakely 4f83482f46 PR libstdc++/79162 disambiguate assignment from string_view
PR libstdc++/79162
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string<C,T,A>::operator=(basic_string_view<C,T>)): Replace
	with a constrained template.
	[!_GLIBCXX_USE_CXX11_ABI]
	(basic_string<C,T,A>::operator=(basic_string_view<C,T>)): Likewise.
	* testsuite/21_strings/basic_string/cons/char/79162.cc: New test.
	* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: New test.

From-SVN: r246128
2017-03-14 14:51:19 +00:00
Jonathan Wakely 11d10beb57 PR libstdc++/79254 simplify exception-safety in copy assignment
PR libstdc++/79254
	* config/abi/pre/gnu.ver: Remove recently added symbols.
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::_M_copy_assign): Remove.
	(basic_string::operator=(const basic_string&)): Don't dispatch to
	_M_copy_assign. If source object is small just deallocate, otherwise
	perform new allocation before making any changes.
	* include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::_M_copy_assign(const basic_string&, true_type)):
	Remove.
	* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
	Test cases where the allocators are equal or the string is small.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.

From-SVN: r245085
2017-02-01 11:41:48 +00:00
Jonathan Wakely a7d47f3526 PR libstdc++/79254 fix exception-safety in std::string::operator=
PR libstdc++/79254
	* config/abi/pre/gnu.ver: Add new symbols.
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::_M_copy_assign): New overloaded functions to perform
	copy assignment.
	(basic_string::operator=(const basic_string&)): Dispatch to
	_M_copy_assign.
	* include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::_M_copy_assign(const basic_string&, true_type)):
	Define, performing rollback on exception.
	* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
	Test exception-safety guarantee.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/util/testsuite_allocator.h (uneq_allocator::swap): Make
	std::swap visible.

From-SVN: r244986
2017-01-27 16:17:04 +00:00
Jonathan Wakely 90aa73309e Define cxx11-abi effective target for libstdc++ tests
PR libstdc++/79075
	* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Remove
	redundant option from cxxflags.
	(check_effective_target_cxx11-abi): Define.
	* testsuite/21_strings/basic_string/allocator/71964.cc: Use cxx11-abi
	effective target.
	* testsuite/21_strings/basic_string/allocator/char/copy.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/minimal.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/move.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/char/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/swap.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.
	* testsuite/23_containers/list/61347.cc: Likewise.
	* testsuite/27_io/basic_fstream/cons/base.cc: Likewise.
	* testsuite/27_io/ios_base/failure/cxx11.cc: Likewise.

From-SVN: r244440
2017-01-13 14:57:33 +00:00
Jonathan Wakely 3330ac383c Add more tests for std::basic_string::find
* testsuite/21_strings/basic_string/operations/find/char/6.cc: New.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/6.cc: New.

From-SVN: r244185
2017-01-06 21:22:40 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Kyrylo Tkachov 39c429372b [libstdc++][testsuite] XFAIL tests relying on long double-to-string conversions on broken newlib
* lib/target-supports.exp
    (check_effective_target_newlib_broken_long_double_io): New check.
    (check_effective_target_frexpl): Likewise.

    * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
    XFAIL run if newlib_broken_long_double_io.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
    Likewise.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
    Likewise.
    * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
    Likewise.

From-SVN: r243558
2016-12-12 15:47:47 +00:00
Jonathan Wakely bf56b0b838 Add std::string constructor for substring of string_view (LWG 2742)
* doc/xml/manual/intro.xml: Document LWG 2742 status.
	* doc/html/*: Regenerate.
	* include/bits/basic_string.h
	(basic_string(const T&, size_type, size_type, const Allocator&)): Add
	constructor for substring of basic_string_view, as per LWG 2742 but
	with additional constraint to fix ambiguity.
	* testsuite/21_strings/basic_string/cons/char/9.cc: New test.
	* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: New test.

From-SVN: r242416
2016-11-15 14:33:20 +00:00
Paolo Carlini 118c842441 testsuite_hooks.h: Rewrite VERIFY in terms of __builtin_printf and __builtin_abort.
2016-10-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/util/testsuite_hooks.h: Rewrite VERIFY in terms of
	__builtin_printf and __builtin_abort.
	* testsuite/lib/libstdc++.exp: Remove _GLIBCXX_ASSERT use.
	* scripts/testsuite_flags.in: Likewise.
	* testsuite/22_locale/time_get/get/char/1.cc: Likewise.
	* testsuite/22_locale/time_get/get/char/2.cc: Likewise.
	* testsuite/22_locale/time_get/get/wchar_t/1.cc: Likewise.
	* testsuite/22_locale/time_get/get/wchar_t/2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/close/char/4879.cc: Likewise, adjust.
	* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/char/26777.cc: Likewise.
	* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc:
	Likewise.
	* testsuite/27_io/objects/char/7.cc: Likewise.
	* testsuite/27_io/objects/char/9661-1.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.
	* testsuite/18_support/50594.cc: Remove 'test' variable, adjust.
	* testsuite/18_support/bad_alloc/what.cc: Likewise.
	* testsuite/18_support/bad_cast/what.cc: Likewise.
	* testsuite/18_support/bad_exception/what.cc: Likewise.
	* testsuite/18_support/bad_typeid/what.cc: Likewise.
	* testsuite/18_support/exception/38732.cc: Likewise.
	* testsuite/18_support/exception/what.cc: Likewise.
	* testsuite/18_support/exception_ptr/64241.cc: Likewise.
	* testsuite/18_support/exception_ptr/current_exception.cc: Likewise.
	* testsuite/18_support/exception_ptr/lifespan.cc: Likewise.
	* testsuite/18_support/exception_ptr/make_exception_ptr.cc: Likewise.
	* testsuite/18_support/exception_ptr/rethrow_exception.cc: Likewise.
	* testsuite/18_support/nested_exception/cons.cc: Likewise.
	* testsuite/18_support/nested_exception/nested_ptr.cc: Likewise.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc: Likewise.
	* testsuite/18_support/nested_exception/rethrow_nested.cc: Likewise.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Likewise.
	* testsuite/18_support/numeric_limits/char16_32_t.cc: Likewise.
	* testsuite/18_support/numeric_limits/digits10.cc: Likewise.
	* testsuite/18_support/numeric_limits/dr559.cc: Likewise.
	* testsuite/18_support/numeric_limits/epsilon.cc: Likewise.
	* testsuite/18_support/numeric_limits/is_iec559.cc: Likewise.
	* testsuite/18_support/numeric_limits/is_signed.cc: Likewise.
	* testsuite/18_support/numeric_limits/lowest.cc: Likewise.
	* testsuite/18_support/numeric_limits/max_digits10.cc: Likewise.
	* testsuite/18_support/numeric_limits/min_max.cc: Likewise.
	* testsuite/18_support/numeric_limits/specialization_default_values.cc:
	Likewise.
	* testsuite/18_support/type_info/hash_code.cc: Likewise.
	* testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Likewise.
	* testsuite/19_diagnostics/error_category/cons/default.cc: Likewise.
	* testsuite/19_diagnostics/error_category/operators/equal.cc: Likewise.
	* testsuite/19_diagnostics/error_category/operators/
	not_equal.cc: Likewise.
	* testsuite/19_diagnostics/error_code/cons/1.cc: Likewise.
	* testsuite/19_diagnostics/error_code/cons/39882.cc: Likewise.
	* testsuite/19_diagnostics/error_code/modifiers/39882.cc: Likewise.
	* testsuite/19_diagnostics/error_code/operators/bool.cc: Likewise.
	* testsuite/19_diagnostics/error_code/operators/equal.cc: Likewise.
	* testsuite/19_diagnostics/error_code/operators/not_equal.cc: Likewise.
	* testsuite/19_diagnostics/error_condition/cons/1.cc: Likewise.
	* testsuite/19_diagnostics/error_condition/cons/39881.cc: Likewise.
	* testsuite/19_diagnostics/error_condition/modifiers/39881.cc: 
	Likewise.
	* testsuite/19_diagnostics/error_condition/operators/bool.cc: Likewise.
	* testsuite/19_diagnostics/error_condition/operators/equal.cc:
	Likewise.
	* testsuite/19_diagnostics/error_condition/operators/not_equal.cc:
	Likewise.
	* testsuite/19_diagnostics/logic_error/what-1.cc: Likewise.
	* testsuite/19_diagnostics/logic_error/what-2.cc: Likewise.
	* testsuite/19_diagnostics/logic_error/what-3.cc: Likewise.
	* testsuite/19_diagnostics/logic_error/what-big.cc: Likewise.
	* testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise.
	* testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise.
	* testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise.
	* testsuite/19_diagnostics/runtime_error/what-big.cc: Likewise.
	* testsuite/19_diagnostics/system_error/cons-1.cc: Likewise.
	* testsuite/19_diagnostics/system_error/what-1.cc: Likewise.
	* testsuite/19_diagnostics/system_error/what-2.cc: Likewise.
	* testsuite/19_diagnostics/system_error/what-3.cc: Likewise.
	* testsuite/19_diagnostics/system_error/what-4.cc: Likewise.
	* testsuite/19_diagnostics/system_error/what-big.cc: Likewise.
	* testsuite/20_util/addressof/1.cc: Likewise.
	* testsuite/20_util/align/1.cc: Likewise.
	* testsuite/20_util/align/2.cc: Likewise.
	* testsuite/20_util/allocator/1.cc: Likewise.
	* testsuite/20_util/allocator/10378.cc: Likewise.
	* testsuite/20_util/allocator/8230.cc: Likewise.
	* testsuite/20_util/allocator_traits/members/allocate_hint.cc:
	Likewise.
	* testsuite/20_util/allocator_traits/members/construct.cc: Likewise.
	* testsuite/20_util/allocator_traits/members/destroy.cc: Likewise.
	* testsuite/20_util/allocator_traits/members/max_size.cc: Likewise.
	* testsuite/20_util/any/assign/exception.cc: Likewise.
	* testsuite/20_util/auto_ptr/1.cc: Likewise.
	* testsuite/20_util/auto_ptr/2.cc: Likewise.
	* testsuite/20_util/auto_ptr/3.cc: Likewise.
	* testsuite/20_util/auto_ptr/4.cc: Likewise.
	* testsuite/20_util/auto_ptr/5.cc: Likewise.
	* testsuite/20_util/auto_ptr/6.cc: Likewise.
	* testsuite/20_util/auto_ptr/7.cc: Likewise.
	* testsuite/20_util/bind/all_bound.cc: Likewise.
	* testsuite/20_util/bind/conv_result.cc: Likewise.
	* testsuite/20_util/bind/cv_quals.cc: Likewise.
	* testsuite/20_util/bind/cv_quals_2.cc
	* testsuite/20_util/bind/nested.cc: Likewise.
	* testsuite/20_util/bind/placeholders.cc: Likewise.
	* testsuite/20_util/bind/ref.cc: Likewise.
	* testsuite/20_util/bind/ref2.cc: Likewise.
	* testsuite/20_util/common_type/requirements/typedefs-1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/2.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/58850.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/dr2020.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/dr934-2.cc: Likewise.
	* testsuite/20_util/duration/comparison_operators/1.cc: Likewise.
	* testsuite/20_util/duration/cons/1.cc: Likewise.
	* testsuite/20_util/duration/cons/2.cc: Likewise.
	* testsuite/20_util/enable_if/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/enable_if/requirements/typedefs_neg.cc: Likewise.
	* testsuite/20_util/enable_shared_from_this/members/assign.cc:
	Likewise.
	* testsuite/20_util/exchange/1.cc: Likewise.
	* testsuite/20_util/forward/a.cc: Likewise.
	* testsuite/20_util/forward/b.cc: Likewise.
	* testsuite/20_util/forward/d.cc: Likewise.
	* testsuite/20_util/function/1.cc: Likewise.
	* testsuite/20_util/function/2.cc: Likewise.
	* testsuite/20_util/function/3.cc: Likewise.
	* testsuite/20_util/function/4.cc: Likewise.
	* testsuite/20_util/function/43397.cc: Likewise.
	* testsuite/20_util/function/5.cc: Likewise.
	* testsuite/20_util/function/6.cc: Likewise.
	* testsuite/20_util/function/7.cc: Likewise.
	* testsuite/20_util/function/8.cc: Likewise.
	* testsuite/20_util/function/9.cc: Likewise.
	* testsuite/20_util/function/assign/move.cc: Likewise.
	* testsuite/20_util/function/cons/move.cc: Likewise.
	* testsuite/20_util/function_objects/dr660.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_bit_flip_set.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_bit_string_set.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_document_words.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_numeric_pattern_set.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_uniform_random.cc: Likewise.
	* testsuite/20_util/hash/operators/size_t.cc: Likewise.
	* testsuite/20_util/hash/quality.cc: Likewise.
	* testsuite/20_util/integral_constant/static_definition.cc: Likewise.
	* testsuite/20_util/integral_constant/true_false_value.cc: Likewise.
	* testsuite/20_util/is_function/24808.cc: Likewise.
	* testsuite/20_util/is_object/24808.cc: Likewise.
	* testsuite/20_util/move_if_noexcept/1.cc: Likewise.
	* testsuite/20_util/move_if_noexcept/constexpr.cc: Likewise.
	* testsuite/20_util/owner_less/cmp.cc: Likewise.
	* testsuite/20_util/pair/1.cc: Likewise.
	* testsuite/20_util/pair/2.cc: Likewise.
	* testsuite/20_util/pair/3.cc: Likewise.
	* testsuite/20_util/pair/4.cc: Likewise.
	* testsuite/20_util/pair/make_pair/constexpr.cc: Likewise.
	* testsuite/20_util/pair/moveable.cc: Likewise.
	* testsuite/20_util/pair/piecewise.cc: Likewise.
	* testsuite/20_util/pair/swap.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp1.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp2.cc: Likewise.
	* testsuite/20_util/ratio/comparisons/comp3.cc: Likewise.
	* testsuite/20_util/ratio/cons/cons1.cc: Likewise.
	* testsuite/20_util/ratio/operations/45866.cc: Likewise.
	* testsuite/20_util/ratio/operations/47913.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops1.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops2.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops3.cc: Likewise.
	* testsuite/20_util/reference_wrapper/invoke.cc: Likewise.
	* testsuite/20_util/scoped_allocator/1.cc: Likewise.
	* testsuite/20_util/scoped_allocator/2.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/assign.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/auto_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/auto_ptr_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/move.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/shared_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/unique_ptr_lvalue_neg.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/comparison/cmp.cc: Likewise.
	* testsuite/20_util/shared_ptr/comparison/less.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/alias.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/alloc.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/auto_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/copy.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/default.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/move.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/nullptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/pointer.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter_ref_1.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter_ref_2.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/weak_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/alloc.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/dr402.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/dr925.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/make.cc: Likewise.
	* testsuite/20_util/shared_ptr/dest/dest.cc: Likewise.
	* testsuite/20_util/shared_ptr/hash/1.cc: Likewise.
	* testsuite/20_util/shared_ptr/misc/24595.cc: Likewise.
	* testsuite/20_util/shared_ptr/misc/42019.cc: Likewise.
	* testsuite/20_util/shared_ptr/misc/io.cc: Likewise.
	* testsuite/20_util/shared_ptr/misc/swap.cc: Likewise.
	* testsuite/20_util/shared_ptr/modifiers/reset.cc: Likewise.
	* testsuite/20_util/shared_ptr/modifiers/reset_alloc.cc: Likewise.
	* testsuite/20_util/shared_ptr/modifiers/reset_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/modifiers/swap.cc: Likewise.
	* testsuite/20_util/shared_ptr/modifiers/swap_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/bool_conv.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/get.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/owner_before.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/unique.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/use_count.cc: Likewise.
	* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/
	move_iterators/1.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	move_iterators/1.cc: Likewise.
	* testsuite/20_util/temporary_buffer.cc: Likewise.
	* testsuite/20_util/time_point/1.cc: Likewise.
	* testsuite/20_util/time_point/2.cc: Likewise.
	* testsuite/20_util/time_point/3.cc: Likewise.
	* testsuite/20_util/time_point/nonmember/constexpr.cc: Likewise.
	* testsuite/20_util/tuple/48476.cc: Likewise.
	* testsuite/20_util/tuple/comparison_operators/comparisons.cc:
	Likewise.
	* testsuite/20_util/tuple/cons/allocators.cc: Likewise.
	* testsuite/20_util/tuple/cons/assignment.cc: Likewise.
	* testsuite/20_util/tuple/cons/big_tuples.cc: Likewise.
	* testsuite/20_util/tuple/cons/constructor.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/23978.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/48476.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/forward_as_tuple.cc:
	Likewise.
	* testsuite/20_util/tuple/creation_functions/make_tuple.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/tie.cc: Likewise.
	* testsuite/20_util/tuple/creation_functions/tie2.cc: Likewise.
	* testsuite/20_util/tuple/cv_tuple_size.cc: Likewise.
	* testsuite/20_util/tuple/element_access/get.cc: Likewise.
	* testsuite/20_util/tuple/element_access/get_by_type.cc: Likewise.
	* testsuite/20_util/tuple/moveable.cc: Likewise.
	* testsuite/20_util/tuple/swap.cc: Likewise.
	* testsuite/20_util/tuple/tuple_size.cc: Likewise.
	* testsuite/20_util/typeindex/comparison_operators.cc: Likewise.
	* testsuite/20_util/typeindex/hash.cc: Likewise.
	* testsuite/20_util/typeindex/hash_code.cc: Likewise.
	* testsuite/20_util/typeindex/name.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/48635.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/move.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/move_array.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/nullptr.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/auto_ptr.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/nullptr.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/pointer.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/pointer_array.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/ptr_deleter.cc: Likewise.
	* testsuite/20_util/unique_ptr/creation/array.cc: Likewise.
	* testsuite/20_util/unique_ptr/creation/single.cc: Likewise.
	* testsuite/20_util/unique_ptr/hash/1.cc: Likewise.
	* testsuite/20_util/unique_ptr/modifiers/43183.cc: Likewise.
	* testsuite/20_util/unique_ptr/specialized_algorithms/
	comparisons.cc: Likewise.
	* testsuite/20_util/unique_ptr/specialized_algorithms/
	comparisons_array.cc: Likewise.
	* testsuite/20_util/unique_ptr/specialized_algorithms/swap.cc:
	Likewise.
	* testsuite/20_util/uses_allocator/construction.cc: Likewise.
	* testsuite/20_util/uses_allocator/value.cc: Likewise.
	* testsuite/20_util/variant/run.cc: Likewise.
	* testsuite/20_util/weak_ptr/observers/owner_before.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/char/copy.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/move.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/char/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/swap.cc: Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.
	* testsuite/21_strings/basic_string/capacity/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/18654.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/shrink_to_fit.cc:
	Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc:
	Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/2.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/shrink_to_fit.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/3.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/4.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/42261.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/5.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/6.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/7.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/8.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/moveable.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/moveable2.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/2.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/3.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/4.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/42261.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/6.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/7.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/moveable.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/moveable2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string/element_access/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string/element_access/char/3.cc: Likewise.
	* testsuite/21_strings/basic_string/element_access/char/4.cc: Likewise.
	* testsuite/21_strings/basic_string/element_access/char/58163.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/char/empty.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/char/front_back.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/58163.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/empty.cc:
	Likewise.
	* testsuite/21_strings/basic_string/element_access/wchar_t/
	front_back.cc: Likewise.
	* testsuite/21_strings/basic_string/init-list.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/10.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/11.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/
	28277.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/6.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/8.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/char/9.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/pod/
	10081-in.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/pod/
	10081-out.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/
	10.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/
	11.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/
	28277.cc: Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/8.cc:
	Likewise.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/9.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/
	move_assign.cc: Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
	move_assign.cc: Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/pop_back/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/pop_back/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/6.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/6.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	stoull.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	to_string.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	dr1261.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stod.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stof.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stoi.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stol.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stold.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stoll.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stoul.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	stoull.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
	to_wstring.cc: Likewise.
	* testsuite/21_strings/basic_string/operations/compare/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/char/13650.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/wchar_t/
	13650.cc: Likewise.
	* testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/data/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/data/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/char/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/rfind/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/substr/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/substr/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/char/3.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/char/4.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/char/5.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/2.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/3.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/4.cc: Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/5.cc: Likewise.
	* testsuite/21_strings/basic_string_view/capacity/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/char/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/char/
	empty.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/char/
	front_back.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/wchar_t/
	empty.cc: Likewise.
	* testsuite/21_strings/basic_string_view/element_access/wchar_t/
	front_back.cc: Likewise.
	* testsuite/21_strings/basic_string_view/inserters/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/inserters/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/inserters/char/3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
	char/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
	wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
	char/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
	wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/
	13650.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
	13650.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/data/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/
	2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/
	3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/
	4.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/char/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/char/
	2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/char/
	3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/
	2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/
	3.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/string_conversion/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/substr/char/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/substr/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operators/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/c_strings/char/1.cc: Likewise.
	* testsuite/21_strings/c_strings/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/char_traits/requirements/char/1.cc: Likewise.
	* testsuite/21_strings/char_traits/requirements/char/57704.cc:
	Likewise.
	* testsuite/21_strings/char_traits/requirements/short/1.cc: Likewise.
	* testsuite/21_strings/char_traits/requirements/wchar_t/1.cc: Likewise.

	* doc/xml/manual/test.xml: Fix typo.

From-SVN: r241069
2016-10-12 16:13:06 +00:00
Jonathan Wakely 1319041924 Avoid reallocation for basic_string::clear()
PR libstdc++/56166
	PR libstdc++/77582
	* include/bits/basic_string.h (basic_string::clear()): Drop reference
	and use empty rep.
	* include/ext/rc_string_base.h (__rc_string_base::_M_clear()):
	Likewise.
	* testsuite/21_strings/basic_string/56166.cc: New.
	* testsuite/ext/vstring/modifiers/clear/56166.cc: New.

From-SVN: r240447
2016-09-23 18:25:34 +01:00