Commit Graph

11846 Commits

Author SHA1 Message Date
Ville Voutilainen
9e2256dcd4 c++: Implement __is_nothrow_constructible and __is_nothrow_assignable
gcc/c-family/ChangeLog:

	* c-common.c (__is_nothrow_assignable): New.
	(__is_nothrow_constructible): Likewise.
	* c-common.h (RID_IS_NOTHROW_ASSIGNABLE): New.
	(RID_IS_NOTHROW_CONSTRUCTIBLE): Likewise.

gcc/cp/ChangeLog:

	* cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
	(CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
	(is_nothrow_xible): Likewise.
	* method.c (is_nothrow_xible): New.
	(is_trivially_xible): Tweak.
	* parser.c (cp_parser_primary_expression): Handle the new RID_*.
	(cp_parser_trait_expr): Likewise.
	* semantics.c (trait_expr_value): Handle the new RID_*.
	(finish_trait_expr): Likewise.

libstdc++-v3/ChangeLog:

	* include/std/type_traits (__is_nt_constructible_impl): Remove.
	(__is_nothrow_constructible_impl): Adjust.
	(is_nothrow_default_constructible): Likewise.
	(__is_nt_assignable_impl): Remove.
	(__is_nothrow_assignable_impl): Adjust.
2020-10-26 15:36:24 +02:00
Jonathan Wakely
93e9a7bcd5 libstdc++: Fix declarations of memalign etc. for freestanding [PR 97570]
libstdc++-v3/ChangeLog:

	PR libstdc++/97570
	* libsupc++/new_opa.cc: Declare size_t in global namespace.
	Remove unused header.
2020-10-26 12:02:50 +00:00
Stephan Bergmann
dc7824734e libstdc++: Add missing exception-specifications in shared_ptr
libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr_base.h
	(_Sp_counted_base::_M_add_ref_lock_nothrow(): Add noexcept to
	definitions to match declaration.
	(__shared_count(const __weak_count&, nothrow_t)): Add noexcept
	to declaration to match definition.
2020-10-26 10:15:45 +00:00
GCC Administrator
efe71fcc4c Daily bump. 2020-10-24 00:16:29 +00:00
Patrick Palka
50106208ff libstdc++: Apply proposed resolutions for LWG 3428, 3447
libstdc++-v3/ChangeLog:

	* include/std/ranges (single_view::single_view): Mark the
	in place constructor explicit as per LWG 3428.
	(take_view): Remove the constraint on the deduction guide's
	template parameter as per LWG 3447.
2020-10-23 09:03:25 -04:00
GCC Administrator
43868df37b Daily bump. 2020-10-23 00:16:30 +00:00
Jonathan Wakely
ca021ac617 libstdc++: Ensure std::forward_as_tuple is defined
The recent changes to reduce includes in <memory_resource> went a bit
too far, and it's possible for std::forward_as_tuple to not be defined
when used.

While doing this, I noticed the problematic calls to forward_as_tuple
were not qualified, so performed unwanted ADL.

libstdc++-v3/ChangeLog:

	* include/experimental/memory_resource: Include <tuple>.
	(polymorphic_allocator::construct): Qualify forward_as_tuple.
	* include/std/memory_resource: Likewise.
2020-10-23 01:12:00 +01:00
Jonathan Wakely
0a74a0e1a2 libstdc++: Fix custom clock in test
This test fails in C++20 mode because std::is_clock is false for the
test clock, because it doesn't define a duration member.

libstdc++-v3/ChangeLog:

	* testsuite/30_threads/condition_variable/members/68519.cc:
	Define recent_epoch_float_clock::duration to meet the Cpp17Clock
	requirements.
2020-10-22 23:14:13 +01:00
Jonathan Wakely
f5d9bc8ae8 libstdc++: Only include <condition_variable> in <shared_mutex> if needed
The <condition_variable> header is not small, so <shared_mutex> should
not include it unless it actually needs std::condition_variable, which
is only the case when we don't have pthread_rwlock_t and the POSIX
Timers option.

The <shared_mutex> header would be even smaller if we had a header for
std::condition_variable (separate from std::condition_variable_any).
That's already planned for a future change.

And <memory_resource> would be even smaller if it was possible to get
std::shared_mutex without std::shared_timed_mutex (which depends on
<chrono>). For that to be effective, the synchronized_pool_resource
would have to create its own simpler version of std::shared_lock without
the timed waiting functions. I have no plans to do that.

libstdc++-v3/ChangeLog:

	* include/std/shared_mutex: Only include <condition_variable>
	when pthread_rwlock_t and POSIX timers are not available.
	(__cpp_lib_shared_mutex, __cpp_lib_shared_timed_mutex): Change
	value to be type 'long'.
	* include/std/version (__cpp_lib_shared_mutex)
	(__cpp_lib_shared_timed_mutex): Likewise.
2020-10-22 18:49:38 +01:00
Jonathan Wakely
b1e7c6fce1 libstdc++: Reduce header dependencies in and on <memory>
By moving std::make_obj_using_allocator and the related "utility
functions for uses-allocator construction" to a new header, we can avoid
including the whole of <memory> in <scoped_allocator> and
<memory_resource>.

In order to simplify the implementation of those utility functions they
now use concepts unconditionally. They are no longer defined if
__cpp_concepts is not defined. To simplify the code that uses those
functions I've introduced a __cpp_lib_make_obj_using_allocator feature
test macro (not specified in the standard, which might be an oversight).
That allows the code in <memory_resource> and <scoped_allocator> to
check the feature test macro to decide whether to use the new utilities,
or fall back to the C++17 code.

At the same time, this reshuffles some of the headers included by
<memory> so that they are (mostly?) self-contained. It should no longer
be necessary to include other headers before <bits/shared_ptr.h> when
other parts of the library want to use std::shared_ptr without including
the whole of <memory>.

libstdc++-v3/ChangeLog:

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/shared_ptr.h: Include <iosfwd>.
	* include/bits/shared_ptr_base.h: Include required headers here
	directly, instead of in <memory>.
	* include/bits/uses_allocator_args.h: New file. Move utility
	functions for uses-allocator construction from <memory> to here.
	Only define the utility functions when concepts are available.
	(__cpp_lib_make_obj_using_allocator): Define non-standard
	feature test macro.
	* include/std/condition_variable: Remove unused headers.
	* include/std/future: Likewise.
	* include/std/memory: Remove headers that are not needed
	directly, and are now inclkuded where they're needed. Include
	new <bits/uses_allocator_args.h> header.
	* include/std/memory_resource: Include only the necessary
	headers. Use new feature test macro to detect support for the
	utility functions.
	* include/std/scoped_allocator: Likewise.
	* include/std/version (__cpp_lib_make_obj_using_allocator):
	Define.
2020-10-22 18:42:03 +01:00
Olivier Hainque
d667beea36 Scope libstdc++ configuration for vxworks to all versions
When libstdc++ is enabled, the current high level configuration
bits should apply the same to all versions of VxWorks.  Adjust the
config triplets matching rules accordingly.

2010-10-21  Olivier Hainque  <hainque@adacore.com>

libstdc++-v3/
	* crossconfig.m4: Turn vxworks matcher into vxworks*.
	* configure.host: Likewise.
	* configure: Regenerate.
2020-10-22 16:40:57 +00:00
GCC Administrator
56ddd5e23a Daily bump. 2020-10-22 08:28:22 +00:00
Jonathan Wakely
945151b7f1 libstdc++: Simplify std::shared_ptr construction from std::weak_ptr
The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of
_Sp_counted_base are very similar, except that the former throws an
exception when the use count is zero and the latter returns false. The
former (and its callers) can be implemented in terms of the latter.
This results in a small reduction in code size, because throwing an
exception now only happens in one place.

libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr.h (shared_ptr(const weak_ptr&, nothrow_t)):
	Add noexcept.
	* include/bits/shared_ptr_base.h (_Sp_counted_base::_M_add_ref_lock):
	Remove specializations and just call _M_add_ref_lock_nothrow.
	(__shared_count, __shared_ptr): Use nullptr for null pointer
	constants.
	(__shared_count(const __weak_count&)): Use _M_add_ref_lock_nothrow
	instead of _M_add_ref_lock.
	(__shared_count(const __weak_count&, nothrow_t)): Add noexcept.
	(__shared_ptr::operator bool()): Add noexcept.
	(__shared_ptr(const __weak_ptr&, nothrow_t)): Add noexcept.
2020-10-21 21:13:41 +01:00
Jonathan Wakely
a186ab670e libstdc++: Make structured bindings always work for subranges [PR 97512]
The definition of ranges::subrange was moved to the new
<bits/ranges_util.h> header so that it could be used in <algorithm>
without including the whole of <ranges>. However, the tuple-like support
that enables subrange to be used with structured bindings was left in
<ranges>. This is arguably conforming (to use a subrange you should
include <ranges>) but it's inconvenient and probably confusing.

This change makes the tuple-like support available whenever subrange
itself is available.

libstdc++-v3/ChangeLog:

	PR libstdc++/97512
	* include/bits/ranges_util.h (tuple_size<subrange>)
	(tuple_element<I, cv subrange>): Move here from ...
	* include/std/ranges: ... here.
	* testsuite/std/ranges/subrange/97512.cc: New test.
2020-10-21 14:40:54 +01:00
Thomas Rodgers
e957b86ca2 libstdc++: Rebase include/pstl to current upstream
From llvm-project/pstl @ 0b2e0e80d96

libstdc++-v3/ChangeLog:

	* include/pstl/algorithm_impl.h: Update file.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/glue_memory_impl.h: Likewise.
	* include/pstl/glue_numeric_impl.h: Likewise.
	* include/pstl/memory_impl.h: Likewise.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/parallel_backend_serial.h: Likewise.
	* include/pstl/parallel_backend_tbb.h: Likewise.
	* include/pstl/parallel_backend_utils.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
2020-10-21 06:11:28 -07:00
GCC Administrator
e2e0428854 Daily bump. 2020-10-21 00:16:36 +00:00
François Dumont
1b6f047683 libstdc++: Refactor _Hashtable to prepare for custom pointers
Limit usage of node pointers in _Hashtable implementation details so that when
we move to allocator custom pointer type we do not need to add an _Alloc
template parameter everywhere which would impact abi.

This is done by reviewing node type definition. It is now based on new basic
types which are not pointer dependant. The _Hashtable helper
types are now using those new node base types and do not receive node pointers.

libstdc++-v3/ChangeLog

	* include/bits/hashtable_policy.h
	(_Hash_node_value_base<>): Remove _Hash_node_base inheritance.
	(_Hash_node_code_cache<bool _Cache_hash_code>): New.
	(_Hash_node_value<typename _Value, bool _Cache_hash_code>): New.
	(_Hash_node<>): Inherits _Hash_node_base<> and _Hash_node_value<>.
	(_Map_base<>::__node_type): Remove.
	(_Map_base<>::iterator): Remove.
	(_Insert_base<>::__hash_cached): New.
	(_Insert_base<>::__constant_iterators): New.
	(_Insert_base<>::__hashtable_alloc): New.
	(_Insert_base<>::__node_type): Remove.
	(_Insert_base<>::__node_ptr): New.
	(_Hash_code_base<>): Remove specializations.
	(_Hash_code_base<>::__node_type): Remove.
	(_Hash_code_base<>::_M_bucket_index(const __node_type*, size_t)):
	Replace by...
	(_Hash_code_base<>::_M_bucket_index(const _Hash_node_value<>&, size_t)):
	...this.
	(_Hash_code_base<>::_M_store_code(__node_type*, __hash_code)):
	Replace by...
	(_Hash_code_base<>::_M_store_code(_Hash_node_code_cache<>&, __hash_code)):
	...this.
	(_Hash_code_base<>::_M_copy_code(__node_type*, const __node_type*)):
	Replace by...
	(_Hash_code_base<>::_M_copy_code(_Hash_node_code_cache<>&,
	const _Hash_node_code_base<>&)): ...this.
	(_Hashtable_base<>::__constant_iterators): Remove.
	(_Hashtable_base<>::__unique_keys): Remove.
	(_Hashtable_base<>::__node_type): Remove.
	(_Hashtable_base<>::iterator): Remove.
	(_Hashtable_base<>::const_iterator): Remove.
	(_Hashtable_base<>::local_iterator): Remove.
	(_Hashtable_base<>::const_local_iterator): Remove.
	(_Hashtable_base<>::__ireturn_type): Remove.
	(_Hashtable_base<>::_Equal_hash_code<>::_S_equals): Replace by...
	(_Hashtable_base<>::_S_equals(__hash_code, const _Hash_node_code_hash<>&)):
	...this.
	(_Hashtable_base<>::_Equal_hash_code<>::_S_node_equals): Replace by...
	(_Hashtable_base<>::_S_node_equals(__hash_code,
	const _Hash_node_code_hash<>&)): ...this.
	(_Hashtable_base<>::_Equal_hash_code<>): Remove.
	(_Hashtable_base<>::_M_equals): Adapt.
	(_Hashtable_baxe<>::_M_node_equals): Adapt.
	(_Equality<>::_M_equal): Adapt.
	(_Hashtable_alloc<>::__node_ptr): New.
	(_Hashtable_alloc<>::__bucket_type): Rename into...
	(_Hashtable_alloc<>::__node_base_ptr): ...this.
	(_Hashtable_alloc<>::__bucket_alloc_type): Rename into...
	(_Hashtable_alloc<>::__buckets_alloc_type): ...this.
	(_Hashtable_alloc<>::__bucket_alloc_traits): Rename into...
	(_Hashtable_alloc<>::__buckets_alloc_traits): ...this.
	(_Hashtable_alloc<>::__buckets_ptr): New.
	(_Hashtable_alloc<>::_M_allocate_node): Adapt.
	(_Hashtable_alloc<>::_M_deallocate_node): Adapt.
	(_Hashtable_alloc<>::_M_deallocate_node_ptr): Adapt.
	(_Hashtable_alloc<>::_M_deallocate_nodes): Adapt.
	(_Hashtable_alloc<>::_M_allocate_buckets): Adapt.
	(_Hashtable_alloc<>::_M_deallocate_buckets): Adapt.
	* include/bits/hashtable.h (_Hashtable<>): Adapt.
2020-10-20 21:30:22 +02:00
Aldy Hernandez
e864d395b4 Convert -Wrestrict pass to ranger.
There is one adjustment to a C++ test which now gives a false positive.
After talking with Martin Sebor, we've concluded this is expected.  There
is no way to communicate that libstdc++ allocated objects are always
less than PTRDIFF_MAX.

gcc/ChangeLog:

	* calls.c (get_size_range): Adjust to work with ranger.
	* calls.h (get_size_range): Add ranger argument to prototype.
	* gimple-ssa-warn-restrict.c (class wrestrict_dom_walker): Remove.
	(check_call): Pull out of wrestrict_dom_walker into a
	static function.
	(wrestrict_dom_walker::before_dom_children): Rename to...
	(wrestrict_walk): ...this.
	(pass_wrestrict::execute): Instantiate ranger.
	(class builtin_memref): Add stmt and query fields.
	(builtin_access::builtin_access): Add range_query field.
	(builtin_memref::builtin_memref): Same.
	(builtin_memref::extend_offset_range): Same.
	(builtin_access::builtin_access): Make work with ranger.
	(wrestrict_dom_walker::check_call): Pull out into...
	(check_call): ...here.
	(check_bounds_or_overlap): Add range_query argument.
	* gimple-ssa-warn-restrict.h (check_bounds_or_overlap):
	Add range_query and gimple stmt arguments.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wrestrict-22.c: New test.
	* g++.dg/torture/pr92421.C: Adjust for ranger.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/capacity/1.cc: Pass
	-Wno-stringop-overflow to test.
2020-10-20 20:46:08 +02:00
Jonathan Wakely
94fd05f1f7 libstdc++: Define noop coroutine details private and inline [PR 95917]
This moves the __noop_coro_frame type, the __noop_coro_fr global
variable, and the __dummy_resume_destroy function from namespace scope,
replacing them with private members of the specialization
coroutine_handle<noop_coroutine_promise>.

The function and variable are also declared inline, so that they
generate no code unless used.

libstdc++-v3/ChangeLog:

	PR libstdc++/95917
	* include/std/coroutine (__noop_coro_frame): Replace with
	noop_coroutine_handle::__frame.
	(__dummy_resume_destroy): Define inline in __frame.
	(__noop_coro_fr): Replace with noop_coroutine_handle::_S_fr
	and define as inline.
	* testsuite/18_support/coroutines/95917.cc: New test.
2020-10-20 11:37:48 +01:00
Jonathan Wakely
2c2278f300 libstdc++: Remove inheritance from std::coroutine_handle<> [LWG 3460]
This removes the coroutine_handle<> base class from the primary template
and the noop_coroutine_promise explicit specialization. To preserve the
API various members are added, as they are no longer inherited from the
base class.

I've also tweaked some indentation and formatting, and replaced
subclause numbers from the standard with stable names like
[coroutine.handle.con].

libstdc++-v3/ChangeLog:

	* include/std/coroutine (coroutine_handle<_Promise>): Remove
	base class. Add constructors, conversions, accessors etc. as
	proposed for LWG 3460.
	(coroutine_handle<noop_coroutine_promise>): Likewise.
	* testsuite/18_support/coroutines/lwg3460.cc: New test.
2020-10-20 11:37:48 +01:00
GCC Administrator
970d683f67 Daily bump. 2020-10-20 00:16:29 +00:00
Jonathan Wakely
e7a0af84d6 libstdc++: Implement std::make_unique_for_overwrite
This is the std::unique_ptr part of P1020R1 (as amended by P1973R1) for
C++20. The std::shared_ptr part still needs to be done.

libstdc++-v3/ChangeLog:

	* include/bits/unique_ptr.h (make_unique_for_overwrite): Define
	for C++20.
	* testsuite/20_util/unique_ptr/creation/array_neg.cc: Remove
	unused header. Adjust standard reference.
	* testsuite/20_util/unique_ptr/creation/for_overwrite.cc: New test.
	* testsuite/20_util/unique_ptr/creation/for_overwrite__neg.cc: New test.
2020-10-19 22:11:39 +01:00
Jonathan Wakely
fc77484c4a libstdc++: Use reserved name for C++20 attribute
Although the compiler supports the [[no_unique_address]] attribute, it's
not a reserved name prior to C++20, so we can't use it in std::tuple.
Use [[__no_unique_address__]] instead.

libstdc++-v3/ChangeLog:

	* include/std/tuple (_Head_base<Idx, Head, true>): Use reserved
	form of __no_unique_address__ attribute because
	no_unique_address is not reserved prior to C++20.
2020-10-19 18:07:21 +01:00
Jonathan Wakely
aa6d2be1e3 libstdc++: Optimize container node-handle type for size
The use of std::optional in _Node_handle makes the node handle types for
associative and unordered containers larger than necessary. It also
greatly increases the amount of code included, as <optional> is quite
large.

The boolean flag that records whether the std::optional contains a value
is redundant, because the _Node_handle::_M_ptr member provides the same
information. If the node handle has a non-null pointer it also has an
allocator, and not otherwise. By replacing std::optional with a custom
union type (and using _M_ptr to tell which union member is active) all
node handle sizes can be reduced by sizeof(allocator_type::pointer).

This makes the node handle types incompatible with previous releases, so
must be done before the C++17 ABI is fixed for GCC 11.

libstdc++-v3/ChangeLog:

	* include/bits/node_handle.h (_Node_handle_common): Replace
	std::optional with custom type.
	* testsuite/20_util/variant/exception_safety.cc: Add missing
	header include.
2020-10-19 18:06:51 +01:00
Jonathan Wakely
4ba60194bb libstdc++: Remove unused header
This header was not part of the patch submitted and reviewed, and was
not added to include/Makefile.am so never gets installed anyway. It
appears to have been committed by mistake, so let's remove it.

libstdc++-v3/ChangeLog:

	* include/precompiled/expc++.h: Removed.
2020-10-19 11:19:28 +01:00
GCC Administrator
019e1c85fe Daily bump. 2020-10-18 00:16:23 +00:00
Ville Voutilainen
1f65bf2aa6 libstdc++: Fix visitor return type diagnostics [PR97449]
libstdc++-v3/ChangeLog:

	PR libstdc++/97449
	* include/std/variant
	(__gen_vtable_impl<>::_S_apply_single_alt):
	Diagnose visitor return type mismatches here..
	(__gen_vtable_impl</*base case*/>::_S_apply):
	..not here.
2020-10-17 23:10:40 +03:00
GCC Administrator
b85d5dc583 Daily bump. 2020-10-16 00:16:29 +00:00
Jonathan Wakely
7dbf96e2a2 libstdc++: Fix typos in copyright notice
It looks like I did a s/a/__a/ substition in one of these headers, and
then copied it to the other one.

libstdc++-v3/ChangeLog:

	* include/std/concepts: Fix typos in copyright notice.
	* include/std/ranges: Likewise.
2020-10-15 19:20:21 +01:00
GCC Administrator
b2698c21f2 Daily bump. 2020-10-15 00:16:34 +00:00
Jonathan Wakely
78198b6021 libstdc++: Fix unspecified comparison to null pointer [PR 97415]
The standard doesn't guarantee that null pointers compare less than
non-null pointers. AddressSanitizer complains about the pptr()> egptr()
comparison in basic_stringbuf::str() when egptr() is null.

libstdc++-v3/ChangeLog:

	PR libstdc++/97415
	* include/std/sstream (basic_stringbuf::str()): Check for
	null egptr() before comparing to non-null pptr().
2020-10-14 18:55:14 +01:00
Jonathan Wakely
2b9c09a78b libstdc++: Fix tests that fail with old std::string ABI
These two tests have started to fail with the old std::string ABI. The
scan-assembler-not checks fail because they match debug info, not code.

Adding -g0 to the test flags fixes them.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/modifiers/assign/char/move_assign_optim.cc:
	Do not generate debug info.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/move_assign_optim.cc:
	Likewise.
2020-10-14 16:15:49 +01:00
Jonathan Wakely
252c9967ba libstdc++: Define some std::string constructors inline
There are a lot of very simple constructors for the old string which are
not defined inline. I don't see any reason for this and it probably
makes them less likely to be optimized away. Move the definitions into
the class body.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (basic_string(const Alloc&))
	(basic_string(const basic_string&)
	(basic_string(const CharT*, size_type, const Alloc&))
	(basic_string(const CharT*, const Alloc&))
	(basic_string(size_type, CharT, const Alloc&))
	(basic_string(initializer_list<CharT>, const Alloc&))
	(basic_string(InputIterator, InputIterator, const Alloc&)):
	Define inline in class body.
	* include/bits/basic_string.tcc (basic_string(const Alloc&))
	(basic_string(const basic_string&)
	(basic_string(const CharT*, size_type, const Alloc&))
	(basic_string(const CharT*, const Alloc&))
	(basic_string(size_type, CharT, const Alloc&))
	(basic_string(initializer_list<CharT>, const Alloc&))
	(basic_string(InputIterator, InputIterator, const Alloc&)):
	Move definitions into class body.
2020-10-14 12:52:47 +01:00
Jonathan Wakely
a1b6b01361 libstdc++: Improve comments for check_effective_target_cxx11-abi
libstdc++-v3/ChangeLog:

	* testsuite/lib/libstdc++.exp (check_effective_target_cxx11-abi):
	Add comments about which test flags get used by the check.
2020-10-14 12:52:47 +01:00
Jonathan Wakely
5e961dba46 libstdc++: Improve comments in std::string tests
The COW std::string does support some features of C++11 allocators, just
not propagation. Change some comments in the tests to be more precise
about that.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/allocator/char/copy.cc: Make
	comment more precise about what isn't supported by COW strings.
	* 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/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/char/operator_plus.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/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/operator_plus.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.
2020-10-14 12:52:47 +01:00
Jonathan Wakely
5ae9ddd480 libstdc++: Enable tests that incorrectly require cxx11-abi
These tests were not being run when -D_GLIBCXX_USE_CXX11_ABI=0 was added
to the test flags, but they actually work OK with the old string.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/allocator/char/minimal.cc:
	Do not require cxx11-abi effective target.
	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
	Likewise.
	* testsuite/27_io/basic_fstream/cons/base.cc: Likewise.
2020-10-14 12:52:46 +01:00
Jonathan Wakely
dc38e25524 libstdc++: Implement LWG 3706 for COW strings
The basic_string deduction guides are defined for the old ABI, but the
tests are currently disabled. This is because a single case fails when
using the old ABI, which is just because LWG 3706 isn't implemented for
the old ABI. That can be done easily, and the tests can be enabled.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string(const _CharT*, const _Alloc&)): Constrain to
	require an allocator-like type to fix CTAD ambiguity (LWG 3706).
	* testsuite/21_strings/basic_string/cons/char/deduction.cc:
	Remove dg-skip-if.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.
2020-10-14 12:51:40 +01:00
GCC Administrator
bdd74cc20c Daily bump. 2020-10-14 00:16:24 +00:00
Nuno Lopes
5204cc561a libstdc++: Fix doxygen comment for std::any_of
libstdc++-v3/ChangeLog:

	* include/bits/stl_algo.h (any_of): Fix incorrect description
	in comment.
2020-10-13 20:21:55 +01:00
Jonathan Wakely
0e0beddd7f libstdc++: Update C++20 status documentation
libstdc++-v3/ChangeLog:

	* doc/xml/manual/evolution.xml: Document some API changes
	and deprecations.
	* doc/xml/manual/intro.xml: Document LWG 2499.
	* doc/xml/manual/status_cxx2020.xml: Update status.
	* doc/html/*: Regenerate.
2020-10-13 17:40:43 +01:00
Jonathan Wakely
16d0b033ca libstdc++: Remove trailing whitespace from XML docs
libstdc++-v3/ChangeLog:

	* doc/xml/book.txml: Remove trailing whitespace.
	* doc/xml/chapter.txml: Likewise.
	* doc/xml/class.txml: Likewise.
	* doc/xml/gnu/fdl-1.3.xml: Likewise.
	* doc/xml/gnu/gpl-3.0.xml: Likewise.
	* doc/xml/manual/abi.xml: Likewise.
	* doc/xml/manual/algorithms.xml: Likewise.
	* doc/xml/manual/allocator.xml: Likewise.
	* doc/xml/manual/appendix_contributing.xml: Likewise.
	* doc/xml/manual/appendix_free.xml: Likewise.
	* doc/xml/manual/appendix_porting.xml: Likewise.
	* doc/xml/manual/atomics.xml: Likewise.
	* doc/xml/manual/auto_ptr.xml: Likewise.
	* doc/xml/manual/backwards_compatibility.xml: Likewise.
	* doc/xml/manual/bitmap_allocator.xml: Likewise.
	* doc/xml/manual/build_hacking.xml: Likewise.
	* doc/xml/manual/codecvt.xml: Likewise.
	* doc/xml/manual/concurrency.xml: Likewise.
	* doc/xml/manual/concurrency_extensions.xml: Likewise.
	* doc/xml/manual/configure.xml: Likewise.
	* doc/xml/manual/containers.xml: Likewise.
	* doc/xml/manual/ctype.xml: Likewise.
	* doc/xml/manual/debug.xml: Likewise.
	* doc/xml/manual/debug_mode.xml: Likewise.
	* doc/xml/manual/diagnostics.xml: Likewise.
	* doc/xml/manual/documentation_hacking.xml: Likewise.
	* doc/xml/manual/evolution.xml: Likewise.
	* doc/xml/manual/internals.xml: Likewise.
	* doc/xml/manual/intro.xml: Likewise.
	* doc/xml/manual/io.xml: Likewise.
	* doc/xml/manual/iterators.xml: Likewise.
	* doc/xml/manual/locale.xml: Likewise.
	* doc/xml/manual/localization.xml: Likewise.
	* doc/xml/manual/messages.xml: Likewise.
	* doc/xml/manual/mt_allocator.xml: Likewise.
	* doc/xml/manual/numerics.xml: Likewise.
	* doc/xml/manual/parallel_mode.xml: Likewise.
	* doc/xml/manual/policy_data_structures.xml: Likewise.
	* doc/xml/manual/prerequisites.xml: Likewise.
	* doc/xml/manual/shared_ptr.xml: Likewise.
	* doc/xml/manual/spine.xml: Likewise.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
	* doc/xml/manual/strings.xml: Likewise.
	* doc/xml/manual/support.xml: Likewise.
	* doc/xml/manual/test.xml: Likewise.
	* doc/xml/manual/test_policy_data_structures.xml: Likewise.
	* doc/xml/manual/using.xml: Likewise.
	* doc/xml/manual/using_exceptions.xml: Likewise.
	* doc/xml/manual/utilities.xml: Likewise.
	* doc/html/*: Regenerate.
2020-10-13 16:50:41 +01:00
GCC Administrator
8be127cac9 Daily bump. 2020-10-13 00:16:26 +00:00
Patrick Palka
c5aad5a418 libstdc++: Apply proposed resolution for LWG 3450
libstdc++-v3/ChangeLog:

	* include/std/ranges (take_while_view::begin): Constrain the
	const overload further as per LWG 3450.
	(take_while_view::end): Likewise.
	* testsuite/std/ranges/adaptors/take_while.cc: Add test for LWG
	3450.
2020-10-12 13:46:24 -04:00
Patrick Palka
e066821b6f libstdc++: Apply proposed resolution for LWG 3449 [PR95322]
Now that the frontend bug PR96805 is fixed, we can cleanly apply the
proposed resolution for this issue.

This slightly deviates from the proposed resolution by declaring _CI a
member of take_view instead of take_view::_Sentinel, since it doesn't
depend on anything within _Sentinel anymore.

libstdc++-v3/ChangeLog:

	PR libstdc++/95322
	* include/std/ranges (take_view::_CI): Define this alias
	template as per LWG 3449 and remove ...
	(take_view::_Sentinel::_CI): ... this type alias.
	(take_view::_Sentinel::operator==): Adjust use of _CI
	accordingly.  Define a second overload that accepts an iterator
	of the opposite constness as per LWG 3449.
	(take_while_view::_Sentinel::operator==): Likewise.
	* testsuite/std/ranges/adaptors/95322.cc: Add tests for LWG 3449.
2020-10-12 13:46:21 -04:00
Jonathan Wakely
c840700852 libstdc++: Update doxyfile to Doxygen 1.8.20 format
libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in: Update to Doxygen 1.8.20 format.
2020-10-12 18:14:01 +01:00
Jonathan Wakely
925eb6a0fb libstdc++: Include C++17 features in doxygen API docs
libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Use __cplusplus=201703L
	so that C++17 features are documented.
2020-10-12 18:14:01 +01:00
Jonathan Wakely
ae3967caff libstdc++: Fix documentation for return values of copy algos
The doxygen comments for these algos all incorrectly claim to use
(first - last) as the difference from the start of the output range to
the return value. As reported on the mailing list by Johannes Choo, it
should be (last - first).

libstdc++-v3/ChangeLog:

	* include/bits/stl_algobase.h (copy, move, copy_backward)
	(move_backward): Fix documentation for returned iterator.
2020-10-12 18:14:01 +01:00
Martin Sebor
1be51a3a9a PR c++/97201 - ICE in -Warray-bounds writing to result of operator new(0)
gcc/cp/ChangeLog:

	PR c++/97201
	* error.c (dump_type_suffix): Handle both the C and C++ forms of
	zero-length arrays.

libstdc++-v3/ChangeLog:

	PR c++/97201
	* libsupc++/new (operator new): Add attribute alloc_size and malloc.

gcc/testsuite/ChangeLog:

	PR c++/97201
	* g++.dg/warn/Wplacement-new-size-8.C: Adjust expected message.
	* g++.dg/warn/Warray-bounds-10.C: New test.
	* g++.dg/warn/Warray-bounds-11.C: New test.
	* g++.dg/warn/Warray-bounds-12.C: New test.
	* g++.dg/warn/Warray-bounds-13.C: New test.
2020-10-12 09:36:26 -06:00
GCC Administrator
2baa36d491 Daily bump. 2020-10-12 00:16:25 +00:00
Clément Chigot
0b9a731127 aix: add FAT library support for libstdc++fs.a
Make libstdc++fs.a a 32/64 bit FAT library.

It is too complicated for the FAT library Makefile fragment to determine if
--enable-libstdcxx-filesystem-ts has been enabled.  This patch checks the
existence of libstdc++fs.a at build time and adds the complementary object
file if it was built.

libstdc++-v3/Changelog:

2020-10-11  Clement Chigot  <clement.chigot@atos.net>

	* config/os/aix/t-aix: Add complementary mode object file to
	libstdc++fs.a
2020-10-11 11:47:00 -04:00