summaryrefslogtreecommitdiff
path: root/libstdc++-v3
AgeCommit message (Collapse)Author
2020-06-03Daily bump.GCC Administrator
2020-06-02libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102)Jonathan Wakely
When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New test. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New test. * testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02Daily bump.GCC Administrator
2020-06-02libstdc++: Fix filesystem::u8path for mingw targets (PR 95392)Jonathan Wakely
When I refactored filesystem::path string conversions in r11-587-584d52b088f9fcf78704b504c3f1f07e17c1cded I failed to update the mingw-specific code in filesystem::u8path, causing a bootstrap failure. This fixes it, and further refactors the mingw-specific code along the same lines as the previous commit. All conversions from UTF-8 strings to wide strings now use the same helper function, __wstr_from_utf8. PR libstdc++/95392 * include/bits/fs_path.h (path::_S_to_string): Move to namespace-scope and rename to ... (__detail::__string_from_range): ... this. [WINDOWS] (__detail::__wstr_from_utf8): New function template to convert a char sequence containing UTF-8 to wstring. (path::_S_convert(Iter, Iter)): Adjust call to _S_to_string. (path::_S_convert_loc(Iter, Iter, const locale&)): Likewise. (u8path(InputIterator, InputIterator)) [WINDOWS]: Use __string_from_range to obtain a contiguous range and __wstr_from_utf8 to obtain a wide string. (u8path(const Source&)) [WINDOWS]: Use __effective_range to obtain a contiguous range and __wstr_from_utf8 to obtain a wide string. (path::_S_convert(const _EcharT*, const _EcharT)) [WINDOWS]: Use __wstr_from_utf8.
2020-06-01libstdc++: Fix __gnu_test::input_iterator_wrapper::operator++(int)Jonathan Wakely
I noticed recently that our input_iterator_wrapper utility for writing tests has the following post-increment operator: void operator++(int) { ++*this; } That fails to meet the Cpp17InputIterator requirement that *r++ is valid. This change makes it return a non-void proxy type that can be deferenced to produce another proxy, which is convertible to the value_type. The second proxy converts to const T& to ensure it can't be written to. * testsuite/util/testsuite_iterators.h: (input_iterator_wrapper::operator++(int)): Return proxy object.
2020-06-01libstdc++: Document API changes in GCC 10Jonathan Wakely
* doc/xml/manual/evolution.xml: Document deprecation of __is_nullptr_t and removal of std::allocator members. * doc/html/manual/api.html: Regenerate.
2020-06-01libstdc++: Fix incorrect Docbook linksJonathan Wakely
The <xref> element creates the link text automatically from the link target, rather than using the text node child of the element. This can be changed by using an endterm attribute, but it's simpler to just use the <link> element instead. * doc/xml/manual/containers.xml: Replace <xref> with <link>. * doc/xml/manual/evolution.xml: Likewise. * doc/html/manual/api.html: Regenerate. * doc/html/manual/containers.html: Regenerate.
2020-06-01libstdc++: Update/streamline Valgrind referencesGerald Pfeifer
* doc/xml/faq.xml: Adjust Valgrind reference and remove another. * doc/html/faq.html: Regenerate.
2020-06-01Daily bump.GCC Administrator
2020-06-01libstdc++: Remove stray change from previous commitGerald Pfeifer
There is a stray change (introducing a bogus line at the top) that came via 2babbb6760c43bcd803a5e168ef5ecb0be8a5121; remove that again. * doc/xml/manual/policy_data_structures_biblio.xml: Remove stray change.
2020-06-01libstdc++: Switch www.cs.princeton.edu to httpsGerald Pfeifer
* doc/xml/manual/policy_data_structures_biblio.xml: Switch www.cs.princeton.edu to https. * doc/html/manual/policy_data_structures.html: Regenerate.
2020-05-31Check for more missing math decls on vxworks.Douglas B Rupp
Use the GLIBCXX_CHECK_MATH_DECL macro to check for the full list of vxworks math decls. libstdc++-v3/ChangeLog * crossconfig.m4 (<*-vxworks>): Check for more math decls. * configure: Rebuild.
2020-05-30Daily bump.GCC Administrator
2020-05-29Avoid nested save_CFLAGS and save_LDFLAGSH.J. Lu
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4. config/ PR bootstrap/95413 * cet.m4: Replace save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS. gcc/ PR bootstrap/95413 * configure: Regenerated. libatomic/ PR bootstrap/95413 * configure: Regenerated. libbacktrace/ PR bootstrap/95413 * configure: Regenerated. libcc1/ PR bootstrap/95413 * configure: Regenerated. libcpp/ PR bootstrap/95413 * configure: Regenerated. libdecnumber/ PR bootstrap/95413 * configure: Regenerated. libgcc/ PR bootstrap/95413 * configure: Regenerated. libgfortran/ PR bootstrap/95413 * configure: Regenerated. libgomp/ PR bootstrap/95413 * configure: Regenerated. libiberty/ PR bootstrap/95413 * configure: Regenerated. libitm/ PR bootstrap/95413 * configure: Regenerated. libobjc/ PR bootstrap/95413 * configure: Regenerated. libphobos/ PR bootstrap/95413 * configure: Regenerated. libquadmath/ PR bootstrap/95413 * configure: Regenerated. libsanitizer/ PR bootstrap/95413 * configure: Regenerated. libssp/ PR bootstrap/95413 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95413 * configure: Regenerated. libvtv/ PR bootstrap/95413 * configure: Regenerated. lto-plugin/ PR bootstrap/95413 * configure: Regenerated. zlib/ PR bootstrap/95413 * configure: Regenerated.
2020-05-29libstdc++: Review unordered_map insert_or_assign/try_emplace (PR 95079)François Dumont
Those methods are making a double lookup in case of insertion, they can perform only one. PR libstdc++/95079 * include/bits/hashtable_policy.h (_Insert_base<>::try_emplace): New. * include/bits/unordered_map.h (unordered_map<>::try_emplace): Adapt. (unordered_map<>::insert_or_assign): Adapt.
2020-05-28Daily bump.GCC Administrator
2020-05-27libstdc++: Fix atomic<FP>::load (PR 95282)Jonathan Wakely
PR libstdc++/95282 * include/bits/atomic_base.h (__atomic_impl::load): Add cv-qualifiers to parameter so that _Tp is deduced as the unqualified type. * testsuite/29_atomics/atomic_float/95282.cc: New test.
2020-05-27libstdc++: Fix view adaptors for mixed-const sentinels and iterators (PR 95322)Jonathan Wakely
The bug report is that transform_view's sentinel<false> cannot be compared to its iterator<true>. The comparison is supposed to use operator==(iterator<Const>, sentinel<Const>) after converting sentinel<false> to sentinel<true>. However, the operator== is a hidden friend so is not a candidate when comparing iterator<true> with sentinel<false>. The required conversion would only happen if we'd found the operator, but we can't find the operator until after the conversion happens. A new LWG issue has been reported, but not yet assigned a number. The solution suggested by Casey Carter is to make the hidden friends of the sentinel types work with iterators of any const-ness, so that no conversions are required. Patrick Palka observed that join_view has a similar problem and a similar fix is used for its sentinel. PR libstdc++/95322 * include/std/ranges (transform_view::_Sentinel): Allow hidden friends to work with _Iterator<true> and _Iterator<false>. (join_view::_Sentinel): Likewise. * testsuite/std/ranges/adaptors/95322.cc: New test.
2020-05-27libstdc++: Fix std::reverse_iterator comparisons (PR 94354)Jonathan Wakely
The std::reverse_iterator comparisons have always been implemented only in terms of equality and less than. In C++98 that made no difference for reasonable code, because when the underlying operators are the same type they are required to support all comparisons anyway. But since LWG 280 it's possible to compare reverse_iterator<X> and reverse_iterator<Y>, and comparisons between X and Y might not support the full set of equality and relational operators. This means that it matters whether we implement operator!= as x.base() != y.base() or !(x.base() == y.base()), and the current implementation is non-conforming. This was already fixed in GCC 10.1 for C++20, this change also fixes it for all other -std modes. PR libstdc++/94354 * include/bits/stl_iterator.h (reverse_iterator): Fix comparison operators to use the correct operations on the underlying iterators. * testsuite/24_iterators/reverse_iterator/rel_ops.cc: New test.
2020-05-27libstdc++: Add new testcase for comparison category typesJonathan Wakely
Comparing a comparison category type to anything except a literal 0 is undefined. This verifies that at least some misuses are diagnosed at compile time. * testsuite/18_support/comparisons/categories/zero_neg.cc: New test.
2020-05-27Daily bump.GCC Administrator
2020-05-26libstdc++: Fix common_iterator::operator-> [PR95322]Patrick Palka
This patch fixes the definition of common_iterator::operator-> when the underlying iterator's operator* returns a non-reference. The first problem is that the class __detail::_Common_iter_proxy is used unqualified. Fixing that revealed another problem: the class's template friend declaration of common_iterator doesn't match up with the definition of common_iterator, because the friend declaration isn't constrained. If we try to make the friend declaration match up by adding constraints, we run into frontend bug PR93467. So we currently can't correctly express this friend relation between __detail::_Common_iter_proxy and common_iterator. As a workaround to this frontend bug, this patch moves the definition of _Common_iter_proxy into the class template of common_iterator so that we could instead express the friend relation via the injected-class-name. (This bug was found when attempting to use views::common to work around the compile failure with the testcase in PR95322.) libstdc++-v3/ChangeLog: PR libstdc++/95322 * include/bits/stl_iterator.h (__detail::_Common_iter_proxy): Remove and instead define it ... (common_iterator::_Proxy): ... here. (common_iterator::operator->): Use it. * testsuite/24_iterators/common_iterator/2.cc: New test. * testsuite/std/ranges/adaptors/95322.cc: New test.
2020-05-23libstdc++: Compile PR93978 testcase with -WallPatrick Palka
Now that the frontend issue PR c++/94038 is thoroughly fixed, the testcase for PR93978 no longer fails to compile with -O -Wall, so add -Wall to the testcase's compile flags to help ensure we don't regress here. libstdc++-v3/ChangeLog: PR libstdc++/93978 * testsuite/std/ranges/adaptors/93978.cc: Add -Wall to dg-additional-options. Avoid unused-but-set-variable warning.
2020-05-23libstdc++: Fix function that can't be constexpr in C++11 (PR 95289)Jonathan Wakely
The body of this function isn't just a return statement, so it can't be constexpr until C++14. PR libstdc++/95289 * include/debug/helper_functions.h (__get_distance): Only declare as a constexpr function for C++14 and up. * testsuite/25_algorithms/copy/debug/95289.cc: New test.
2020-05-23libstdc++: Refactor filesystem::path string conversionsJonathan Wakely
This simplifies the logic of converting Source arguments and pairs of InputIterator arguments into the native string format. For any input that is a contiguous range of path::value_type (or char8_t for POSIX) a string view can be created and the conversion can be done directly, with no intermediate allocation. Previously some cases created a basic_string unnecessarily, for example construction from a pair of path::string_type::iterators, or a pair of non-const value_type* pointers. * include/bits/fs_path.h (__detail::_S_range_begin) (__detail::_S_range_end, path::_S_string_from_iter): Replace with overloaded function template __detail::__effective_range. (__detail::__effective_range): New overloaded function template to create a basic_string or basic_string_view for an effective range. (__detail::__value_type_is_char): Use __detail::__effective_range. Do not use remove_const on value type. (__detail::__value_type_is_char_or_char8_t): Likewise. (path::path(const Source&, format)) (path::path(const Source&, const locale&)) (path::operator/=(const Source&), path::append(const Source&)) (path::concat(const Source&)): Use __detail::__effective_range. (path::_S_to_string(InputIterator, InputIterator)): New function template to create a string view if possible, or string otherwise. (path::_S_convert): Add overloads that convert a string returned by __detail::__effective_range. Use if-constexpr to inline conversion logic from all overloads of _Cvt::_S_convert. (path::_S_convert_loc): Add overload that converts a string. Use _S_to_string to avoid allocation when possible. (path::_Cvt): Remove. (path::operator+=(CharT)): Remove indirection through path::concat. * include/experimental/bits/fs_path.h (path::_S_convert_loc): Add overload for non-const pointers, to avoid constructing a std::string. * src/c++17/fs_path.cc (path::_S_convert_loc): Replace conditional compilation with call to _S_convert.
2020-05-23libstdc++: Remove incorrect static specifiersJonathan Wakely
These functions were originally static members of the path class, but the 'static' specifiers were not removed when they were moved to namespace scope. This causes ODR violations when the functions are called from functions defined in the header, which is incompatible with Nathan's modules branch. Change them to 'inline' instead. * include/bits/fs_path.h (__detail::_S_range_begin) (__detail::_S_range_end): Remove unintentional static specifiers. * include/experimental/bits/fs_path.h (__detail::_S_range_begin) (__detail::_S_range_end): Likewise.
2020-05-23libstdc++: Simplify filesystem::path SFINAE constraintsJonathan Wakely
This replaces the filesystem::__detail::_Path SFINAE helper with two separate helpers, _Path and _Path2. This avoids having one helper which tries to check two different sets of requirements. The _Path helper now uses variable templates instead of a set of overloaded functions to detect specializations of basic_string or basic_string_view. The __not_<is_void<remove_pointer_t<_Tp1>> check is not necessary in C++20 because iterator_traits<void*> is now empty. For C++17 replace that check with a __safe_iterator_traits helper with partial specializations for void pointers. Finally, the __is_encoded_char check no longer uses remove_const_t, which means that iterators with a const value_type will no longer be accepted as arguments for path creation. Such iterators resulted in undefined behaviour anyway, so it's still conforming to reject them in the constraint checks. * include/bits/fs_path.h (filesystem::__detail::__is_encoded_char): Replace alias template with variable template. Don't remove const. (filesystem::__detail::__is_path_src): Replace overloaded function template with variable template and specializations. (filesystem::__detail::__is_path_iter_src): Replace alias template with class template. (filesystem::__detail::_Path): Use __is_path_src. Remove support for iterator pairs. (filesystem::__detail::_Path2): New alias template for checking InputIterator requirements. (filesystem::__detail::__constructible_from): Remove. (filesystem::path): Replace _Path<Iter, Iter> with _Path2<Iter>. * testsuite/27_io/filesystem/path/construct/80762.cc: Check with two constructor arguments of void and void* types.
2020-05-21libstdc++: Enable simple invocation of runtest in testsuiteMatthias Kretz
2020-05-21 Matthias Kretz <kretz@kde.org> * testsuite/Makefile.am: Remove dup target_triplet and set tool, allowing runtest to work without arguments. * testsuite/Makefile.in: Regenerate. Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
2020-05-21libstdc++: Avoid constraint recursion with iterator_traits (PR 93983)Jonathan Wakely
Checking whether a filesystem::path constructor argument is an iterator requires instantiating std::iterator_traits. In C++20 that checks for satisfaction of std::iterator_traits constraints, which checks if the type is copyable, which can end up recursing back to the path constructor. The fix in LWG 3420 is to reorder the cpp17-iterator concept's constraints to check if the type looks vaguely like an iterator before checking copyable. That avoids the recursion for types which definitely aren't iterators, but isn't foolproof. PR libstdc++/93983 * include/bits/iterator_concepts.h (__detail::__cpp17_iterator): Reorder constraints to avoid recursion when constructors use iterator_traits (LWG 3420). * testsuite/24_iterators/customization_points/lwg3420.cc: New test.
2020-05-21libstdc++: Use macro for nodiscard attributeJonathan Wakely
* include/experimental/socket (basic_socket::is_open() (basic_socket_acceptor::is_open()): Use _GLIBCXX_NODISCARD macro.
2020-05-21libstdc++: Better requirements checking in Networking TSJonathan Wakely
Define concepts and traits for checking type requirements. * include/experimental/bits/net.h (__endpoint, __protocol) (__acceptable_protocol, __inet_protocol): New concepts. (__detail::__is_endpoint): Move trait from <experimental/socket>. (__is_protocol, __is_acceptable_protocol, __is_inet_protocol): New traits. (__endpoint, __protocol, __acceptable_protocol): New variable templates. * include/experimental/socket (__is_endpoint): Move to net.h header. (basic_socket, basic_socket_acceptor): Check requirements.
2020-05-21libstdc++: Fix net::basic_socket::close(error_code&)Jonathan Wakely
Also add some missing member functions, nodiscard attributes, and noexcept-specifiers. * include/experimental/executor (use_future_t::use_future_t()): Fix incorrect noexcept-specifier. * include/experimental/internet (basic_resolver_results): Adjust whitespace. * include/experimental/socket (__basic_socket_impl::release): Add member function. (basic_socket(io_context&, const endpoint_type&)): Fix argument to target constructor. (basic_socket::release(), basic_socket::release(error_code&)): Add missing member functions. (basic_socket::is_open()): Add nodiscard attribute. (basic_socket::close(error_code&)): Pass argument to base function. (basic_socket_acceptor::release()) (basic_socket_acceptor::release(error_code&)): Add missing member functions. (basic_socket_acceptor::is_open()): Add nodiscard attribute. (basic_socket_streambuf::error()): Add noexcept. (basic_socket_iostream::error()): Likewise. * testsuite/experimental/net/socket/basic_socket.cc: New test.
2020-05-21libstdc++: Use 'using' for types in Networking TS headersJonathan Wakely
* include/experimental/buffer: Replace typedefs with alias-declarations. * include/experimental/executor: Likewise. * include/experimental/internet: Likewise. * include/experimental/socket: Likewise. * include/experimental/timer: Likewise.
2020-05-19libstdc++: Use RDRAND as fallback if RDSEED keeps failing (PR 94087)Jonathan Wakely
It's not difficult for multiple threads to drain the entropy available to the RDSEED instruction, at which point we throw an exception. This change will try to use RDRAND after RDSEED fails repeatedly, and only throw if RDRAND also fails repeatedly. This doesn't guarantee a random value can always be read, but reduces the likelihood of failure when using the RDSEED instruction. PR libstdc++/94087 * src/c++11/random.cc (__x86_rdseed): Allow fallback function to be passed in. (__x86_rdseed_rdrand): New function that uses rdseed with rdrand fallback. (random_device::_M_init): Use __x86_rdseed_rdrand when both instructions are available. * testsuite/26_numerics/random/random_device/94087.cc: New test.
2020-05-18c++: Explain fn template argument type/value mismatches [PR66439]Patrick Palka
In fn_type_unifcation, we are passing NULL_TREE as the 'in_decl' parameter to coerce_template_parms, and this is causing template type/value mismatch error messages to get suppressed regardless of the value of 'complain'. This means that when substitution into a function template fails due to a type/value mismatch between a template parameter and the provided template argument, we just say "template argument deduction/substitution failed:" without a followup explanation of the failure. Fix this by passing 'fn' instead of NULL_TREE to coerce_template_parms. gcc/cp/ChangeLog: PR c++/66439 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as the 'in_decl' parameter to coerce_template_parms. gcc/testsuite/ChangeLog: PR c++/66439 * g++.dg/cpp2a/concepts-ts4.C: Expect a "type/value mismatch" diagnostic. * g++.dg/cpp2a/concepts-ts6.C: Likewise. * g++.dg/template/error56.C: Likewise. * g++.dg/template/error59.C: New test. libstdc++-v3/ChangeLog: PR c++/66439 * testsuite/20_util/pair/astuple/get_neg.cc: Prune "type/value mismatch" messages. * testsuite/20_util/tuple/element_access/get_neg.cc: Likewise.
2020-05-15x86: Also check if -fcf-protection worksH.J. Lu
When defaulting CET run-time support to auto, check if -fcf-protection works. Even if the stage1 GCC doesn't support -fcf-protection, since the final GCC does, CET run-time support will be enabled by default if binutils support CET. config/ PR bootstrap/95147 * cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works when defaulting to auto. libatomic/ PR bootstrap/95147 * configure: Regenerated. libbacktrace/ PR bootstrap/95147 * configure: Regenerated. libgcc/ PR bootstrap/95147 * configure: Regenerated. libgfortran/ PR bootstrap/95147 * configure: Regenerated. libgomp/ PR bootstrap/95147 * configure: Regenerated. libitm/ PR bootstrap/95147 * configure: Regenerated. libobjc/ PR bootstrap/95147 * configure: Regenerated. libphobos/ PR bootstrap/95147 * configure: Regenerated. libquadmath/ PR bootstrap/95147 * configure: Regenerated. libsanitizer/ PR bootstrap/95147 * configure: Regenerated. libssp/ PR bootstrap/95147 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95147 * configure: Regenerated. libvtv/ PR bootstrap/95147 * configure: Regenerated. zlib/ PR bootstrap/95147 * configure: Regenerated.
2020-05-14x86: Default CET run-time support to autoH.J. Lu
CET has been added since GCC 8. This patch defaults CET run-time support to auto. It enables CET run-time support if asssembler supports CET instructions and multi-byte NOPs are enabled via SSE2. config/ * cet.m4 (GCC_CET_FLAGS): Change default to auto. gcc/ * configure: Regenerated. libatomic/ * configure: Regenerated. libbacktrace/ * configure: Regenerated. libcc1/ * configure: Regenerated. libcpp/ * configure: Regenerated. libdecnumber/ * configure: Regenerated. libgcc/ * configure: Regenerated. libgfortran/ * configure: Regenerated. libgomp/ * configure: Regenerated. libitm/ * configure: Regenerated. libobjc/ * configure: Regenerated. libquadmath/ * configure: Regenerated. libsanitizer/ * configure: Regenerated. libssp/ * configure: Regenerated. libstdc++-v3/ * configure: Regenerated. libvtv/ * configure: Regenerated. zlib/ * configure: Regenerated.
2020-05-13x86-vxworks malloc aligns to 8 bytes like solarisAlexandre Oliva
Vxworks 7's malloc, like Solaris', only ensures 8-byte alignment of returned pointers on 32-bit x86, though GCC's stddef.h defines max_align_t with 16-byte alignment for __float128. This patch enables on x86-vxworks the same memory_resource workaround used for x86-solaris. The testsuite also had a workaround, defining BAD_MAX_ALIGN_T and xfailing the test; extend those to x86-vxworks as well, and remove the check for char-aligned requested allocation to be aligned like max_align_t. With that change, the test passes on x86-vxworks; I'm guessing that's the same reason for the test not to pass on x86-solaris (and on x86_64-solaris -m32), so with the fix, I'm tentatively removing the xfail. for libstdc++-v3/ChangeLog PR libstdc++/77691 * include/experimental/memory_resource (__resource_adaptor_imp::do_allocate): Handle max_align_t on x86-vxworks as on x86-solaris. (__resource_adaptor_imp::do_deallocate): Likewise. * testsuite/experimental/memory_resource/new_delete_resource.cc: Drop xfail. (BAD_MAX_ALIGN_T): Define on x86-vxworks as on x86-solaris. (test03): Drop max-align test for char-aligned alloc.
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.