summaryrefslogtreecommitdiff
path: root/libstdc++-v3
AgeCommit message (Collapse)Author
2020-05-12Actually comment the new testsUlrich Drepper
2020-05-12Implent C++20 std::atomic_flag::testUlrich Drepper
* include/bits/atomic_base.h (atomic_flag): Implement test member function. * include/std/version: Define __cpp_lib_atomic_flag_test. * testsuite/29_atomics/atomic_flag/test/explicit.cc: New file. * testsuite/29_atomics/atomic_flag/test/implicit.cc: New file.
2020-05-11Revert "libstdc++ Enhance thread safety of debug mode iterators"François Dumont
This reverts commit 0b83c4fabb899fdbb3ae60ed75b7004b7859fae9.
2020-05-10libstdc++ Enhance thread safety of debug mode iteratorsFrançois Dumont
Avoids race condition when checking for an iterator to be singular or to be comparable to another iterator. * src/c++/debug.cc (_Safe_sequence_base::_M_attach_single): Set attached iterator sequence pointer and version. (_Safe_sequence_base::_M_detach_single): Reset detached iterator. (_Safe_iterator_base::_M_attach): Remove attached iterator sequence pointer and version asignments. (_Safe_iterator_base::_M_attach_single): Likewise. (_Safe_iterator_base::_M_detach_single): Remove detached iterator reset. (_Safe_iterator_base::_M_singular): Use atomic load to access parent sequence. (_Safe_iterator_base::_M_can_compare): Likewise. (_Safe_iterator_base::_M_get_mutex): Likewise. (_Safe_local_iterator_base::_M_attach): Remove attached iterator container pointer and version assignments. (_Safe_local_iterator_base::_M_attach_single): Likewise. (_Safe_unordered_container_base::_M_attach_local_single): Set attached iterator container pointer and version. (_Safe_unordered_container_base::_M_detach_local_single): Reset detached iterator.
2020-05-07libstdc++: Fix whitespace in ChangelogJonathan Wakely
2020-05-07libstdc++: Fix some C++20 algorithms to work in parallel modeJonathan Wakely
Some new algorithms need to use _GLIBCXX_STD_A to refer to the "normal" version of the algorithm, to workaround the namespace dance done for parallel mode. PR libstdc++/94971 (partial) * include/bits/ranges_algo.h (ranges::__sample_fn): Qualify std::sample using macro to work in parallel mode. (__sort_fn): Likewise for std::sort. (ranges::__nth_element_fn): Likewise for std::nth_element. * include/bits/stl_algobase.h (lexicographical_compare_three_way): Likewise for std::__min_cmp. * include/parallel/algobase.h (lexicographical_compare_three_way): Add to namespace std::__parallel.
2020-05-07libstdc++: Make relational operators work with const guarded iterators (PR ↵Jonathan Wakely
92472) This is a correct fix for the incorrect cppcheck suggestion to make these parameters const. In order to that, the dereference operators need to be const. The conversions to the underlying iterator can be const too. PR c/92472 * include/parallel/multiway_merge.h (_GuardedIterator::operator*) (_GuardedIterator::operator _RAIter, _UnguardedIterator::operator*) (_UnguardedIterator::operator _RAIter): Add const qualifier. (operator<(_GuardedIterator&, _GuardedIterator&) (operator<=(_GuardedIterator&, _GuardedIterator&) (operator<(_UnguardedIterator&, _UnguardedIterator&) (operator<=(_UnguardedIterator&, _UnguardedIterator&): Change parameters to const references.
2020-05-07Update the baseline symbols for SPARC64/LinuxEric Botcazou
2020-05-06libstdc++ std::fill overload for std::vector<bool>::iteratorFrançois Dumont
Extend the overload so that it is used even when _GLIBCXX_DEBUG mode is activated. * include/bits/stl_algobase.h (struct _Bit_iterator): New declaration. (std::__fill_a1(_Bit_iterator, _Bit_iterator, const bool&)): Likewise. * include/bits/stl_bvector.h (__fill_bvector): Move outside _GLIBCXX_STD_C namespace. (fill(_Bit_iterator, _Bit_iterator, const bool&)): Likewise and rename into... (__fill_a1): ...this. * testsuite/25_algorithms/fill/bvector/1.cc: New.
2020-05-06x32: Update baseline_symbols.txtH.J. Lu
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
2020-05-06libstdc++: Update Solaris baselines for GCC 10.1Rainer Orth
I just remembered that the libstdc++ ABI baselines haven't been updated for the GCC 10 release yet. This patch corrects this for Solaris/SPARC and x86. Created on master with make new-abi-baseline on i386-pc-solaris2.11 and sparc-sun-solaris2.11, bootstrapped on gcc-10 branch without regressions. * config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate. * config/abi/post/i386-solaris/amd64/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt: Likewise.
2020-05-06Revert "Use const for template argument."Martin Liska
This reverts commit 03f9754665b889e0988d0392db1eb35e91b97693.
2020-05-06libstdc++: Document library versioning for 9.[123] and 10.1Jonathan Wakely
* doc/xml/manual/abi.xml (abi.versioning.history): Document library versions for GCC 9.[123] and 10.1 releases. * doc/html/*: Regenerate.
2020-05-06libstdc++: Update {x86_64,i?86,powerpc64,s390x,aarch64}-linux baselines for ↵Jakub Jelinek
GCC 10.1 On Wed, May 06, 2020 at 10:49:13AM +0200, Rainer Orth wrote: > I just remembered that the libstdc++ ABI baselines haven't been updated > for the GCC 10 release yet. This patch corrects this for Solaris/SPARC > and x86. Oops, here are the updates from Fedora packages built during the weekend. 2020-05-06 Jakub Jelinek <jakub@redhat.com> * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update. * config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
2020-05-05Add missing ChangeLog entries.Martin Liska
2020-05-05Use const for template argument.Martin Liska
libstdc++-v3/ChangeLog: 2020-02-04 Martin Liska <mliska@suse.cz> PR c/92472 * include/parallel/multiway_merge.h: Use const for _Compare template argument.
2020-05-04libstdc++: Fix the return type of __cxa_finalizeFangrui Song
This should return void according to the Itanium C++ ABI. 2020-05-04 Fangrui Song <maskray@google.com> * libsupc++/cxxabi.h (__cxa_finalize): Fix return type.
2020-05-04libstdc++: Fix broken link to SGI STL FAQJonathan Wakely
The previous URL to an entry in the wayback machine now redirects to a page saying "SGI.com Tech Archive Resources now retired" so use an older entry from the archive. * doc/xml/faq.xml: Use working link for SGI STL FAQ. * doc/html/*: Regenerate.
2020-05-04libstdc++: Fix incorrect size calculation in PMR resource (PR 94906)Jonathan Wakely
Calculating the size of a chunk being returned to the upstream allocator was done with a 32-bit type, so it wrapped if the chunk was 4GB or larger. I don't know how to test this without allocating 4GB, so there's no test in the testsuite. It has been tested manually with allocations sizes and alignments exceeding 4GB. PR libstdc++/94906 * src/c++17/memory_resource.cc (monotonic_buffer_resource::_Chunk::release): Use size_t for shift operands.
2020-05-04libstdc++: Avoid negating a size_t [pr 94747]Nathan Sidwell
Although the code here is well formed, it doesn't show intent well. The reason checkers trigger on this is that it is a cause of real bugs. So, negate a ptrdiff_t instead. * libsupc++/dyncast.cc (__dynamic_cast): Cast offsetof to ptrdiff_t before negation, to show intent more clearly.
2020-05-04libstdc++: Make pmr::synchronized_pool_resource work without libpthread (PR ↵Jonathan Wakely
94936) I implicitly assumed that programs using pmr::synchronized_pool_resource would also be using multiple threads, and so the weak symbols in gthr-posix.h would be resolved by linking to libpthread. If that isn't true then it crashes when trying to use pthread_key_create. This commit makes the pool resource check __gthread_active_p() before using thread-specific data, and just use a single set of memory pools when there's only a single thread. PR libstdc++/94936 * src/c++17/memory_resource.cc (synchronized_pool_resource::_TPools): Add comment about single-threaded behaviour. (synchronized_pool_resource::_TPools::move_nonempty_chunks()): Hoist class member access out of loop. (synchronized_pool_resource::synchronized_pool_resource()) (synchronized_pool_resource::~synchronized_pool_resource()) (synchronized_pool_resource::release()): Check __gthread_active_p before creating and/or deleting the thread-specific data key. (synchronized_pool_resource::_M_thread_specific_pools()): Adjust assertions. (synchronized_pool_resource::do_allocate(size_t, size_t)): Add fast path for single-threaded case. (synchronized_pool_resource::do_deallocate(void*, size_t, size_t)): Likewise. Return if unable to find a pool that owns the allocation. * testsuite/20_util/synchronized_pool_resource/allocate_single.cc: New test. * testsuite/20_util/synchronized_pool_resource/cons_single.cc: New test. * testsuite/20_util/synchronized_pool_resource/release_single.cc: New test.
2020-05-03libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933)Jonathan Wakely
The overload for byte types uses memset and isn't constexpr. This adds the specifier and uses std::is_constant_evaluated() to provide a compile-time alternative. PR libstdc++/94933 * include/bits/stl_algobase.h (__fill_a1): Make overload for byte types usable in constant expressions. * testsuite/25_algorithms/fill_n/constexpr.cc: Test with bytes and non-scalars.
2020-05-01libstdc++: Add more tests for _E10, _E11 etc. (PR 94901)Jonathan Wakely
PR libstdc++/94901 * testsuite/17_intro/badnames.cc: Test values between _E9 and _E24 too.
2020-05-01libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)Jonathan Wakely
The deduced return type causes the instantiation of the function body, which can then require the instantiation of std::projected::operator* which is intentionally not defined. This patch uses a helper trait to define the return type, so that the function body doesn't need to be instantiated. That helper trait can then also be used in other places that currently check the return type of ranges::iter_move (iter_rvalue_reference_t and indirectly_readable). 2020-05-01 Jonathan Wakely <jwakely@redhat.com> Patrick Palka <ppalka@redhat.com> PR libstdc++/92894 * include/bits/iterator_concepts.h (ranges::__cust_imove::_IMove): Add trait to determine return type and an alias for it. (ranges::__cust_imove::_IMove::operator()): Use __result instead of deduced return type. (iter_rvalue_reference_t): Use _IMove::__type instead of checking the result of ranges::iter_move. (__detail::__indirectly_readable_impl): Use iter_rvalue_reference_t instead of checking the result of ranges::iter_move. * testsuite/24_iterators/customization_points/92894.cc: New test. * testsuite/24_iterators/indirect_callable/92894.cc: New test.
2020-05-01libstdc++: Replace reserved identifier _T with _Tp (PR 94901)Jonathan Wakely
The libstdc++ manual documents that _T can not be used, because it's a macro in system headers on some targets. PR libstdc++/94901 * include/std/type_traits (__is_complete_or_unbounded): Replace BADNAME _T with _Tp. * testsuite/17_intro/badnames.cc: New test.
2020-04-30libstdc++: Avoid errors in allocator's noexcept-specifier (PR 89510)Jonathan Wakely
This fixes a regression due to the conditional noexcept-specifier on std::allocator::construct and std::allocator::destroy, as well as the corresponding members of new_allocator, malloc_allocator, and allocator_traits. Those noexcept-specifiers were using expressions which might be ill-formed, which caused errors outside the immediate context when checking for the presence of construct and destroy in SFINAE contexts. The fix is to use the is_nothrow_constructible and is_nothrow_destructible type traits instead, because those traits are safe to use even when the construction/destruction itself is not valid. The is_nothrow_constructible trait will be false for a type that is not also nothrow-destructible, even if the new-expression used in the construct function body is actually noexcept. That's not the correct answer, but isn't a problem because providing a noexcept-specifier on these functions is not required by the standard anyway. If the answer is false when it should be true, that's suboptimal but OK (unlike giving errors for valid code, or giving a true answer when it should be false). PR libstdc++/89510 * include/bits/alloc_traits.h (allocator_traits::_S_construct) (allocator_traits::_S_destroy) (allocator_traits<allocator<T>>::construct): Use traits in noexcept-specifiers. * include/bits/allocator.h (allocator<void>::construct) (allocator<void>::destroy): Likewise. * include/ext/malloc_allocator.h (malloc_allocator::construct) (malloc_allocator::destroy): Likewise. * include/ext/new_allocator.h (new_allocator::construct) (new_allocator::destroy): Likewise. * testsuite/20_util/allocator/89510.cc: New test. * testsuite/ext/malloc_allocator/89510.cc: New test. * testsuite/ext/new_allocator/89510.cc: New test.
2020-04-29libstdc++: Fix outdated comment about std::string instantiations (PR 94854)Jonathan Wakely
PR libstdc++/94854 * include/bits/basic_string.tcc: Update comment about explicit instantiations.
2020-04-28libstdc++: Fixes for feature test macros (PR 91480)Jonathan Wakely
Remove the non-standard __cpp_lib_allocator_is_always_equal macro and add the missing macros for P1032R1. PR libstdc++/91480 * include/bits/allocator.h (__cpp_lib_allocator_is_always_equal): Remove non-standard macro. * include/bits/stl_iterator.h (__cpp_lib_constexpr_iterator): Define to indicate P1032R1 support. * include/bits/stl_pair.h (__cpp_lib_constexpr_utility): Likewise. * include/std/string_view (__cpp_lib_constexpr_string_view): Likewise. * include/std/tuple (__cpp_lib_constexpr_tuple): Likewise. * include/std/version (__cpp_lib_allocator_is_always_equal): Remove. (__cpp_lib_constexpr_iterator, __cpp_lib_constexpr_string_view) (__cpp_lib_constexpr_tuple, __cpp_lib_constexpr_utility): Define. * testsuite/20_util/function_objects/constexpr_searcher.cc: Check feature test macro. * testsuite/20_util/tuple/cons/constexpr_allocator_arg_t.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/copy/char/ constexpr.cc: Likewise. * testsuite/24_iterators/insert_iterator/constexpr.cc: Likewise.
2020-04-28libstdc++: Fix regression in std::_Construct (PR 94831)Jonathan Wakely
By trying to reuse the existing std::_Construct function as a wrapper for std::construct_at I introduced regressions, because changing std::_Construct to return non-void made it ill-formed for array types. The solution is to revert _Construct to its former state, and change allocator_traits::construct to explicitly call construct_at instead. This decouples all the existing callers of _Construct from the new construct_at requirements. PR libstdc++/94831 * include/bits/alloc_traits.h (_S_construct): Restore placement new-expression for C++11/14/17 and call std::construct_at directly for C++20. * include/bits/stl_construct.h (_Construct): Revert to non-constexpr function returning void. * testsuite/20_util/specialized_algorithms/ uninitialized_value_construct/94831.cc: New test. * testsuite/23_containers/vector/cons/94831.cc: New test.
2020-04-28libstdc++: Fix subrange::advance and subrange::prev (LWG 3433)Patrick Palka
This implements the proposed resolution of LWG 3433, which fixes subrange::advance when called with a negative argument. libstdc++-v3/ChangeLog: LWG 3433 subrange::advance(n) has UB when n < 0 * include/std/ranges (subrange::prev): Fix typo. (subrange::advance): Handle a negative argument as per the proposed resolution of LWG 3433. * testsuite/std/ranges/subrange/lwg3433.cc: New test.
2020-04-28coroutines: Fix handling of non-class coroutine returns [PR94759]Iain Sandoe
From the standard: The header <coroutine> defines the primary template coroutine_traits such that if ArgTypes is a parameter pack of types and if the qualified-id R::promise_type is valid and denotes a type, then coroutine_traits<R,ArgTypes...> has the following publicly accessible member: using promise_type = typename R::promise_type; this should not prevent more specialised cases and the following code should be accepted, but is currently rejected with: 'error: coroutine return type ‘void’ is not a class' This is because the check for non-class-ness of the return value was in the wrong place; it needs to be carried out in a SFINAE context. The following patch removes the restriction in the traits template instantiation and allows for the case that the ramp function could return void. The <coroutine> header is amended to implement the required functionality. gcc/cp/ChangeLog: 2020-04-28 Iain Sandoe <iain@sandoe.co.uk> PR c++/94759 * coroutines.cc (coro_promise_type_found_p): Do not exclude non-classes here (this needs to be handled in the coroutine header). (morph_fn_to_coro): Allow for the case where the coroutine returns void. gcc/testsuite/ChangeLog: 2020-04-28 Iain Sandoe <iain@sandoe.co.uk> PR c++/94759 * g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C: Adjust for updated error messages. * g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C: Likewise. * g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C: Likewise. * g++.dg/coroutines/coro-missing-promise.C: Likewise. * g++.dg/coroutines/pr93458-5-bad-coro-type.C: Liekwise. * g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: New test. libstdc++-v3/ChangeLog: 2020-04-28 Jonathan Wakely <jwakely@redhat.com> Iain Sandoe <iain@sandoe.co.uk> PR c++/94759 * include/std/coroutine: Implement handing for non- class coroutine return types.
2020-04-24libstdc++: Make net::service_already_exists default constructibleJonathan Wakely
The LWG issue I created is Tentatively Ready and proposes to declare a public default constructor, rather than the private one I added recently. * include/experimental/executor (service_already_exists): Make default constructor public (LWG 3414). * testsuite/experimental/net/execution_context/make_service.cc: Check the service_already_exists can be default constructed.
2020-04-24libstdc++: Fix constructor constraints for std::any (PR 90415)Jonathan Wakely
This removes a non-standard extension to std::any which causes errors for valid code, due to recursive instantiation of a trait that isn't supposed to be in the constraints. It also removes some incorrect constraints on the in_place_type<T> constructors and emplace members, which were preventing creating a std::any object with another std::any as the contained value. 2020-04-24 Kamlesh Kumar <kamleshbhalui@gmail.com> Jonathan Wakely <jwakely@redhat.com> PR libstdc++/90415 PR libstdc++/92156 * include/std/any (any): Rename template parameters for consistency with the standard. (any::_Decay): Rename to _Decay_if_not_any. (any::any(T&&):: Remove is_constructible from constraints. Remove non-standard overload. (any::any(in_place_type_t<T>, Args&&...)) (any::any(in_place_type_t<T>, initializer_list<U>, Args&&...)) (any::emplace(Args&&...)) (any::emplace(initializer_list<U>, Args&&...)): Use decay_t instead of _Decay. * testsuite/20_util/any/cons/90415.cc: New test. * testsuite/20_util/any/cons/92156.cc: New Test. * testsuite/20_util/any/misc/any_cast_neg.cc: Make dg-error directives more robust. * testsuite/20_util/any/modifiers/92156.cc: New test.
2020-04-23libstdc++: Mark experimental::net::system_context ctor deletedThomas Rodgers
* include/experimental/net/executor (system_context): Mark system_context::system_context() = delete. * testsuite/experimental/net/executor/1.cc: Add new test to check system_context is not default constructible.
2020-04-23libstdc++: Update C++20 library status docsJonathan Wakely
This reorganises the C++20 status table, grouping the proposals by category. It also adds more proposals, and documents all the feature test macros for C++20 library changes. * doc/xml/manual/status_cxx2020.xml: Update C++20 status table. * doc/html/*: Regenerate.
2020-04-23libstdc++: Change __cpp_lib_array_constexpr for C++17 againJonathan Wakely
This partially reverts my previous change related to this macro. The C++20 constexpr iterator requirements are always met by array:iterator, because it's just a pointer. So the macro can be set to 201803 even in C++17 mode. * include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Revert value for C++17 to 201803L because P0858R0 is supported for C++17. * include/std/version (__cpp_lib_array_constexpr): Likewise. * testsuite/23_containers/array/element_access/constexpr_c++17.cc: Check for value corresponding to P0031R0 features being tested. * testsuite/23_containers/array/requirements/constexpr_iter.cc: Check for value corresponding to P0858R0 features being tested.
2020-04-23libstdc++: Define __cpp_lib_three_way_comparison for freestandingJonathan Wakely
The <compare> header is always supported, not only for hosted configs. * include/std/version (__cpp_lib_three_way_comparison): Define for freestanding builds.
2020-04-23coroutines, libstdc++-v3: Update to n4861 C++20 DIS.Iain Sandoe
Update the inline namespace to __n4861. Add '__cpp_lib_coroutine' defined to 201902L per n4861. libstdc++-v3/ChangeLog: 2020-04-23 Iain Sandoe <iain@sandoe.co.uk> * include/std/coroutine: Update the inline namespace to __n4861. Add the __cpp_lib_coroutine define, set to 201902L. * include/std/version: Add __cpp_lib_coroutine, set to 201902L. gcc/testsuite/ChangeLog: 2020-04-23 Iain Sandoe <iain@sandoe.co.uk> * g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C: Adjust for changed inline namespace. * g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C: Likewise. * g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C: Likewise * g++.dg/coroutines/coro.h: Likewise
2020-04-22libstdc++: Define __cpp_lib_execution feature test macroJonathan Wakely
This macro has never been defined by libstdc++, despite supporting the parallel algorithms. It should have a different value for C++17 and C++20, because P1001R2 should not be supported in C++17, but unsequenced_policy is defined for C++17 (see PR p4702). * include/std/execution (__cpp_lib_execution): Define to indicate support for P0024R2 and P1001R2. * include/std/version (__cpp_lib_execution): Define. * testsuite/25_algorithms/pstl/feature_test.cc: Only test macro defined by <algorithm>, move other tests to new tests ... * testsuite/25_algorithms/pstl/feature_test-2.cc: New test. * testsuite/25_algorithms/pstl/feature_test-3.cc: New test. * testsuite/25_algorithms/pstl/feature_test-4.cc: New test. * testsuite/25_algorithms/pstl/feature_test-5.cc: New test.
2020-04-22libstdc++: Update (and revert) value of __cpp_lib_array_constexprJonathan Wakely
This macro should have been updated to 201811 when the last C++20 changes were implemented. However those changes are not enabled for C++17 mode, so the macro should only have the new value in C++20 mode. This change ensures that the macro is defined to 201603 for C++17 and 201811 for C++20. * include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Define different values for C++17 and C++20, to indicate different feature sets. Update value for C++20 to indicate P1032R1 support. * include/std/version (__cpp_lib_array_constexpr): Likewise. * testsuite/23_containers/array/comparison_operators/constexpr.cc: Check feature test macro. * testsuite/23_containers/array/element_access/constexpr_c++17.cc: New test. * testsuite/23_containers/array/requirements/constexpr_fill.cc: Check feature test macro. * testsuite/23_containers/array/requirements/constexpr_iter.cc: Test in C++17 mode and check feature test macro.
2020-04-22libstdc++: Do not define __cpp_lib_constexpr_algorithms in <utility>Jonathan Wakely
The C++20 draft and SD-6 both say this should only be in <version> and <algorithm>, not in <utility>. * include/std/utility (__cpp_lib_constexpr_algorithms): Do not define here. * testsuite/20_util/exchange/constexpr.cc: Do not expect macro to be defined by <utility>.
2020-04-22libstdc++: Update __cpp_lib_concepts valueJonathan Wakely
* include/std/functional (__cpp_lib_concepts): Update macro value to indicate P1964R2 support. * include/std/version (__cpp_lib_concepts): Likewise. * testsuite/std/concepts/1.cc: Adjust expected value. * testsuite/std/concepts/2.cc: Likewise.
2020-04-22libstdc++: Rename __cpp_lib_constexpr_invoke macroJonathan Wakely
This macro was renamed after it was added to the working draft, but we never renamed it in libstdc++. We haven't made a release with the old macro name, so I see no need to keep it around. * include/std/functional (__cpp_lib_constexpr_invoke): Rename to __cpp_lib_constexpr_functional. * include/std/version (__cpp_lib_constexpr_invoke): Likewise. * testsuite/20_util/function_objects/invoke/constexpr.cc: Adjust.
2020-04-22libstdc++: Add missing feature test macrosJonathan Wakely
These macros all correspond to features that are already supported, but the macro was not defined when the feature was implemented. * include/bits/ptr_traits.h (__cpp_lib_constexpr_memory): Define to indicate P1006R1 support. (__cpp_lib_to_address): Define to indicate P0653R2 support. * include/bits/range_access.h (__cpp_lib_ssize): Define to indicate P1227R2 support. * include/bits/ranges_algo.h (__cpp_lib_shift): Define to indicate P0769R2 support. * include/std/atomic (__cpp_lib_atomic_float): Define to indicate P0020R6 support. * include/std/memory (__cpp_lib_assume_aligned): Define to indicate P1007R3 support. * include/std/memory_resource (__cpp_lib_polymorphic_allocator): Define to indicate P0339R6 support. * include/std/string_view (__cpp_lib_starts_ends_with): Define to indicate P0457R2 support. * include/std/type_traits (__cpp_lib_is_nothrow_convertible): Define to indicate P0758R1 support. (__cpp_lib_remove_cvref): Define to indicate P0550R2 support. (__cpp_lib_type_identity): Define to indicate P0887R1 support. * include/std/version (__cpp_lib_atomic_float) (__cpp_lib_is_nothrow_convertible, __cpp_lib_remove_cvref) (__cpp_lib_type_identity, __cpp_lib_assume_aligned) (__cpp_lib_constexpr_memory, __cpp_lib_polymorphic_allocator) (__cpp_lib_shift, __cpp_lib_ssize, __cpp_lib_starts_ends_with) (__cpp_lib_to_address): Define. * testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number.
2020-04-22libstdc++: Remove non-standard feature test macrosJonathan Wakely
These macros were replaced by __cpp_lib_map_try_emplace and __cpp_lib_unordered_map_try_emplace, because those names are more descriptive. We've kept both old and new names so far, but I think we can remove the old ones now. * include/bits/stl_map.h (__cpp_lib_map_insertion): Remove old macro. * include/bits/unordered_map.h (__cpp_lib_unordered_map_insertion): Likewise. * include/std/version (__cpp_lib_map_insertion) (__cpp_lib_unordered_map_insertion): Remove.
2020-04-22libstdc++: Update value of __cpp_lib_jthread macroJonathan Wakely
* include/std/condition_variable (__cpp_lib_jthread): Remove redundant definition. * include/std/stop_token (__cpp_lib_jthread): Update macro value to indicate P1869R1 support. * include/std/version (__cpp_lib_jthread): Update value. * testsuite/30_threads/condition_variable_any/stop_token/1.cc: Check for updated macro value. * testsuite/30_threads/condition_variable_any/stop_token/2.cc: Likewise. * testsuite/30_threads/jthread/1.cc: Likewise. * testsuite/30_threads/jthread/2.cc: Likewise. * testsuite/30_threads/stop_token/1.cc: Likewise. * testsuite/30_threads/stop_token/2.cc: Likewise.
2020-04-22libstdc++: Improve tests for __cpp_lib_erase_if macroJonathan Wakely
* testsuite/21_strings/basic_string/erasure.cc: Check for updated value of __cpp_lib_erase_if. * testsuite/23_containers/deque/erasure.cc: Likewise. * testsuite/23_containers/forward_list/erasure.cc: Likewise. * testsuite/23_containers/list/erasure.cc: Likewise. * testsuite/23_containers/map/erasure.cc: Likewise. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/23_containers/vector/erasure.cc: Likewise.
2020-04-21libstdc++: Fix __normal_iterator comparisons for C++20Jonathan Wakely
This fixes a regression introduced when I replaced __normal_iterator's relational operators with operator<=>. If the wrapped iterator type doesn't define operator<=> then __normal_iterator doesdn't either, which breaks any use of fancy pointers that don't define <=>. The regression was found when trying to build cmcstl2. The solution is to use synth-three-way to define __normal_iterator's spaceship operator, so that it is still defined even if the wrapped type only supports operator<. * include/bits/stl_iterator.h (__normal_iterator): Use synth-three-way to define operator<=>. * testsuite/24_iterators/normal_iterator/cmp_c++20.cc: New test.
2020-04-21libstdc++: Improve C++14 and C++17 status docsJonathan Wakely
This adds a full table of contents for the C++14 and C++17 standards, with status for each part. For C++14 the list of proposals is removed, as it adds little value now that everything is supported. For C++17 the table of proposals is retained, because it documents he feature test macros for the features. * doc/Makefile.am (xml_sources_manual): Add missing XML files. * doc/Makefile.in: Regenerate. * doc/xml/manual/status_cxx1998.xml: Refer to "this section" instead of "this page". * doc/xml/manual/status_cxx2011.xml: Formatting and other corrections to the C++11 status table. * doc/xml/manual/status_cxx2014.xml: Replace list of C++14 feature proposals with table matching contents of the C++14 standard. * doc/xml/manual/status_cxx2017.xml: Add table matching contents of the C++17 standard. * doc/html/*: Regenerate.
2020-04-21libstdc++: Support arrays in std::is_nothrow_constructible (PR 94149)Jonathan Wakely
The front end now supports parenthesized initialization for arrays in C++20, so extend std::is_nothrow_constructible to support them too. gcc/testsuite: PR c++/94149 * g++.dg/cpp2a/paren-init24.C: Fix FIXMEs. libstdc++-v3: PR c++/94149 * include/std/type_traits (__is_nt_constructible_impl): Add partial specializations for bounded arrays with non-empty initializers. * testsuite/20_util/is_nothrow_constructible/value_c++20.cc: New test.