[committed] libstdc++: Enable doxygen processing for C++20 components

2021-08-18 Thread Jonathan Wakely via Gcc-patches
Improve grouping, add @since and @deprecated information. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (PREDEFINED): Enable doxygen processing for C++20 components and components that depend on compiler features. * include/bits

[committed] libstdc++: Improve doxygen comments in

2021-08-18 Thread Jonathan Wakely via Gcc-patches
Add notes about deprecation and modern replacements. Fix bogus "memory_adaptors" group name. Use markdown for formatting. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_function.h: Improve doxygen comments. Tested powerpc64le-linux. Committed to trunk. commi

[committed] libstdc++: Improve doxygen documentation for std::unique_ptr

2021-08-18 Thread Jonathan Wakely via Gcc-patches
Add more detailed documentation for unique_ptr and related components. The new alias templates for the _MakeUniq SFINAE helper make the generated docs look better too. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/unique_ptr.h (default_delete): Add @since tag.

Re: [PATCH v2] libstdc++: improve documentation for bits/stl_function.h [PR51539]

2021-08-18 Thread Jonathan Wakely via Gcc-patches
On Wed, 18 Aug 2021 at 13:49, Jonathan Wakely wrote: > > On Tue, 17 Aug 2021 at 21:39, Krzysztof Żelechowski wrote: > > - /// One of the @link memory_adaptors adaptors for member > > "memory_adaptors" here is a bad name (see > which introduced it) but we can just > ch

[committed] libstdc++: Tweak whitespace

2021-08-19 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Committed to trunk. commit c8a1cf1a7a8be1dc0de48035d88fecf4954e37ba Author: Jonathan Wakely Date: Wed Aug 18 16:57:47 2021 libstdc++: Tweak whitespace Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_tre

[committed] libstdc++: Improve overflow check for file timestamps

2021-08-19 Thread Jonathan Wakely via Gcc-patches
The current code assumes that system_clock::duration is nanoseconds, and also performs a value-changing conversion from nanoseconds::max() to double (which doesn't matter after dividing by 1e9, but triggers a warning with Clang nonetheless). A better solution is to use system_clock::duration::max(

[committed] libstdc++: Improve doxygen docs for smart pointers

2021-08-19 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/shared_ptr.h: Add @since and @headerfile tags. * include/bits/unique_ptr.h: Add @headerfile tags. Tested powerpc64le-linux. Committed to trunk. commit 30b300de8eb9a53c8ad8d80caf06e386e916bc66 Author: Jonathan

[committed] libstdc++: Document P1739R4 status [PR100139]

2021-08-19 Thread Jonathan Wakely via Gcc-patches
We should document the status of this unimplemented feature. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/100139 * doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table. * doc/html/manual/status.html: Regenerate. Tested powerpc64le-linux.

[committed] libstdc++: Fix move construction of std::tuple with array elements [PR101960]

2021-08-19 Thread Jonathan Wakely via Gcc-patches
An array member cannot be direct-initialized in a ctor-initializer-list, so use the base class' move constructor, which does the right thing for both arrays and non-arrays. This constructor could be defaulted, but that would make it trivial for some specializations, which would change the argument

[committed] libstdc++: Don't check always-true condition [PR101965]

2021-08-19 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/101965 * include/std/charconv (__to_chars_i): Remove redundant check. Tested powerpc64le-linux. Committed to trunk. commit 85a709595005b5df4b2ee9d81717a5df19c0023f Author: Jonathan Wakely Date: Thu Aug 19 13

[committed] libstdc++: Update Doxygen config template to Doxygen 1.9.2

2021-08-19 Thread Jonathan Wakely via Gcc-patches
This adds my new SHOW_HEADERFILE option, and removes some obsolete options. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in: Update to Doxygen 1.9.2 Tested powerpc64le-linux. Committed to trunk. commit 778044ccf59205e85bc5fdcd1760d789fdd05022 Author: J

Re: [committed] libstdc++: Document P1739R4 status [PR100139]

2021-08-19 Thread Jonathan Wakely via Gcc-patches
On 19/08/21 13:03 +0100, Jonathan Wakely wrote: We should document the status of this unimplemented feature. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/100139 * doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table. * doc/html/manual/s

[committed] libstdc++: Skip filesystem tests that depend on permissions [PR90787]

2021-08-20 Thread Jonathan Wakely via Gcc-patches
Tests that depend on filesystem permissions FAIL if run on Windows or as root. Add a helper function to detect those cases, so the tests can skip those checks gracefully. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/90787 * testsuite/27_io/filesystem/itera

Re: [committed] libstdc++: Skip filesystem tests that depend on permissions [PR90787]

2021-08-23 Thread Jonathan Wakely via Gcc-patches
On 20/08/21 15:16 +0100, Jonathan Wakely wrote: Tests that depend on filesystem permissions FAIL if run on Windows or as root. Add a helper function to detect those cases, so the tests can skip those checks gracefully. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc+

[committed] libstdc++: Use __builtin_expect in __dynamic_cast

2021-08-23 Thread Jonathan Wakely via Gcc-patches
The null pointer check is never needed for correct code, only to gracefully handle undefined cases. Add __builtin_expect to be sure that we don't pessimize the valid uses. libstdc++-v3/ChangeLog: * libsupc++/dyncast.cc (__dynamic_cast): Add __builtin_expect to precondition check.

[committed] libstdc++: Add default template argument to basic_istream_view

2021-08-23 Thread Jonathan Wakely via Gcc-patches
The standard shows this default template argument in the synopsis, but it was missing in libstdc++. libstdc++-v3/ChangeLog: * include/std/ranges (basic_istream_view): Add default template argument. * testsuite/std/ranges/istream_view.cc: Check it. Tested x86_64-linux. Co

[committed] libstdc++: Fix mismatched class-key tags

2021-08-24 Thread Jonathan Wakely via Gcc-patches
Clang warns about this, but GCC doesn't (see PR c++/102036). Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * src/c++11/cxx11-shim_facets.cc: Fix mismatched class-key in explicit instantiation definitions. Tested powerpc64le-linux. Committed to trunk. commit d8b7282ea2

[committed] libstdc++: Add std::is_layout_compatible trait for C++20

2021-08-24 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/type_traits (is_layout_compatible): Define. (is_corresponding_member): Define. * include/std/version (__cpp_lib_is_layout_compatible): Define. * testsuite/20_util/is_layout_compatible/is_correspo

Re: [committed] libstdc++: Add std::is_layout_compatible trait for C++20

2021-08-24 Thread Jonathan Wakely via Gcc-patches
On 24/08/21 16:13 +0100, Jonathan Wakely wrote: Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/type_traits (is_layout_compatible): Define. (is_corresponding_member): Define. * include/std/version (__cpp_lib_is_layout_compatible): Define. *

Re: [PATCH] c++: Fix unnecessary error when top-level cv-qualifiers is dropped [PR101783]

2021-08-24 Thread Jonathan Wakely via Gcc-patches
>PR c++/101387 > >gcc/cp/ChangeLog: >PR c++/101387 >* tree.c (cp_build_qualified_type_real): Excluding typedef from error > >gcc/testsuite/ChangeLog: >PR c++/101387 >* g++.dg/parse/pr101783.C: New test. This is the wrong PR number. How has this ptch been tested? Ha

[committed] wwwdocs: Fix grammar in gcc-11 release notes

2021-08-24 Thread Jonathan Wakely via Gcc-patches
Committed as obvious. commit 6404392bcf74d2af7d171cc1df9b5c001d2218f8 Author: Jonathan Wakely Date: Tue Aug 24 18:06:25 2021 +0100 Fix grammar in gcc-11 release notes diff --git a/htdocs/gcc-11/changes.html b/htdocs/gcc-11/changes.html index b8bb2e69..6dec8856 100644 --- a/htdocs/gcc-11/c

[committed] libstdc++: Remove __gnu_cxx::rope::erase(size_type) [PR102048]

2021-08-25 Thread Jonathan Wakely via Gcc-patches
This function claims to remove a single character at index p, but it actually removes p+1 characters beginning at p. So r.erase(0) removes the first character, but r.erase(1) removes the second and third, and r.erase(2) removes the second, third and fourth. This is not a useful API. The overload i

[committed] libstdc++: Fix conditions for optimizing uninitialized algos [PR102064]

2021-08-25 Thread Jonathan Wakely via Gcc-patches
While laying some groundwork for constexpr std::vector, I noticed some bugs in the std::uninitialized_xxx algorithms. The conditions being checked for optimizing trivial cases were not quite right, as shown in the examples in the PR. This consolidates the checks into a single macro. The macro has

[committed] libstdc++: Fix non-reserved names in

2021-08-25 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/valarray: Uglify 'func' parameters. * testsuite/17_intro/names.cc: Add 'func' to checks. Tested powerpc64le-linux. Committed to trunk. commit 0163bbaaef119ef9e98c4b3dcba159609f77c818 Author: Jonathan Wakely D

[committed] libstdc++: Fix names.cc test failures on Windows

2021-08-25 Thread Jonathan Wakely via Gcc-patches
The Windows CRT headers define structs with members called f, x, y etc so don't check those. There are also lots of unnecessary function parameters in mingw headers using non-reserved names, e.g. uses p and z as parameters of mingw_gettimeofday uses j as a parameter of imaxabs uses l, o and fun

[committed] libstdc++: Add another non-reserved name to tests

2021-08-25 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc: Check 'sz'. Tested x86_64-linux. Committed to trunk. commit ea5674687ac45fe7242c57220b699337899881f0 Author: Jonathan Wakely Date: Wed Aug 25 23:19:25 2021 libstdc++: Add another non-reserved

[committed] libstdc++: Make Networking TS headers more portable [PR100285]

2021-08-26 Thread Jonathan Wakely via Gcc-patches
Add more preprocessor conditions to check for constants being defined before using them, so that the Networking TS headers can be compiled on a wider range of platforms. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/100285 * configure.ac: Check for O_NONBLO

[committed] libstdc++: Add static assertions for std::function requirements

2021-08-26 Thread Jonathan Wakely via Gcc-patches
Add static assertions to std::function, so that more user-friendly diagnostics are given when trying to store a non-copyable target object. These preconditions were added as "Mandates:" by LWG 2447, but I'm committing them separately from implementing that, to allow just this change to be backport

[committed] libstdc:: Use markdown for Doxygen comments in std::function

2021-08-26 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/std_function.h (function): Adjust doxygen comments. * include/bits/unique_ptr.h (make_unique_for_overwrite): Change parameter name to match doxygen comment. Tested powerpc64le-linux. Committed

[committed] libstdc++: Avoid a move in std::function construction (LWG 2447)

2021-08-26 Thread Jonathan Wakely via Gcc-patches
This makes the std::function constructor use perfect forwarding, to avoid an unnecessary move-construction of the target. This means we need to rewrite the _Function_base::_Base_manager::_M_init_functor function to use a forwarding reference, and so can reuse it for the clone operation. Also simpl

Re: [PATCH] Fix inline versioned namespace bootstrap

2021-08-27 Thread Jonathan Wakely via Gcc-patches
On Fri, 27 Aug 2021 at 21:58, François Dumont via Libstdc++ wrote: > > Since std::allocator is not specialized anymore in > _GLIBCXX_INLINE_VERSION mode _ExtPtr_allocator specialization do > not compile > > because std::allocator is incomplete. That doesn't look right ... it should be complete. T

Re: [PATCH] Fix inline versioned namespace bootstrap

2021-08-28 Thread Jonathan Wakely via Gcc-patches
On Fri, 27 Aug 2021 at 22:17, Jonathan Wakely wrote: > > On Fri, 27 Aug 2021 at 21:58, François Dumont via Libstdc++ > wrote: > > > > Since std::allocator is not specialized anymore in > > _GLIBCXX_INLINE_VERSION mode _ExtPtr_allocator specialization do > > not compile > > > > because std::alloca

Re: [PATCH] Fix inline versioned namespace bootstrap

2021-08-28 Thread Jonathan Wakely via Gcc-patches
On Sat, 28 Aug 2021 at 10:26, Jonathan Wakely wrote: > > On Fri, 27 Aug 2021 at 22:17, Jonathan Wakely wrote: > > > > On Fri, 27 Aug 2021 at 21:58, François Dumont via Libstdc++ > > wrote: > > > > > > Since std::allocator is not specialized anymore in > > > _GLIBCXX_INLINE_VERSION mode _ExtPtr_a

Re: [committed] libstdc++: Avoid a move in std::function construction (LWG 2447)

2021-08-28 Thread Jonathan Wakely via Gcc-patches
On 27/08/21 00:13 +0100, Jonathan Wakely wrote: This makes the std::function constructor use perfect forwarding, to avoid an unnecessary move-construction of the target. This means we need to rewrite the _Function_base::_Base_manager::_M_init_functor function to use a forwarding reference, and so

[committed] libstdc++: Fix inefficiency in filesystem::absolute [PR99876]

2021-08-28 Thread Jonathan Wakely via Gcc-patches
When the path is already absolute, the call to current_path() is wasteful, because operator/ will ignore the left operand anyway. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/99876 * src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form, to av

[committed] libstdc++: Fix std::allocator for versioned namespace

2021-08-28 Thread Jonathan Wakely via Gcc-patches
Removing the allocator specialization for the versioned namespace breaks _Extptr_allocator because the allocator specialization was still declared in , making it an incomplete type. It wrong to remove that specialization anyway, because it is still needed pre-C++20. This removes the #if ! _GLIBCX

[PATCH] c++: Fix docs on assignment of virtual bases [PR60318]

2021-08-31 Thread Jonathan Wakely via Gcc-patches
The description of behaviour is incorrect, the virtual base gets assigned before entering the bodies of A::operator= and B::operator=, not after. The example is also ill-formed (passing a string literal to char*) and undefined (missing return from Base::operator=). Signed-off-by: Jonathan Wakely

Re: [PATCH] libstdc++-v3: Check for TLS support on mingw

2021-08-31 Thread Jonathan Wakely via Gcc-patches
It looks like my questions about this patch never got an answer, and it never got applied. Could somebody say whether TLS is enabled for native *-*-mingw* builds? If it is, then we definitely need to add GCC_CHECK_TLS to the cross-compiler config too. For a linux-hosted x86_64-w64-mingw32 cross c

[committed] libstdc++: Fix 17_intro/names.cc failures on Solaris

2021-08-31 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc: Undefine some more names used by Solaris system headers. Tested x86_64-linux and sparc-solaris2.11. Committed to trunk. commit 69b09c5599b201ac039db564c303f7b20d87e0df Author: Jonathan Wakely

[committed] libstdc++: Fix ip::tcp::resolver test failure on Solaris

2021-08-31 Thread Jonathan Wakely via Gcc-patches
Solaris 11 does not have "http" in /etc/services, which causes this test to fail. Try some other services until we find one that works. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/experimental/net/internet/resolver/ops/lookup.cc: Try other service if "http

[committed] libstdc++: Improve error handling in Net TS name resolution

2021-08-31 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/experimental/internet (__make_resolver_error_code): Handle EAI_SYSTEM errors. (basic_resolver_results): Use __make_resolver_error_code. Use Glibc NI_MAXHOST and NI_MAXSERV values for buffer sizes. T

[committed] libstdc++: Add missing return for atomic timed wait [PR102074]

2021-08-31 Thread Jonathan Wakely via Gcc-patches
This adds a missing return statement to the non-futex wait-until operation. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102074 * include/bits/atomic_timed_wait.h (__timed_waiter_pool) [!_GLIBCXX_HAVE_PLATFORM_TIMED_WAIT]: Add missing return. Test

[committed] libstdc++: Remove redundant noexcept-specifier on definitions

2021-08-31 Thread Jonathan Wakely via Gcc-patches
These destructors are noexcept anyway. I removed the redundant noexcept from the error_category destructor's declaration in r0-123475, but didn't remove it from the defaulted definition in system_error.cc. That causes warnings if the library is built with Clang. This removes the redundant noexcept

[committed] libstdc++: Fix broken autoconf check for O_NONBLOCK

2021-08-31 Thread Jonathan Wakely via Gcc-patches
On 26/08/21 12:46 +0100, Jonathan Wakely wrote: PR libstdc++/100285 * configure.ac: Check for O_NONBLOCK. This check was broken, oops. Fixed like so. Tested x86_64-linux. Committed to trunk. commit 1cacdef0d1a3f587691735d1822d584b68eba593 Author: Jonathan Wakely Date: Tue

[committed] libstdc++: Add valid range checks to std::span constructors [PR98421]

2021-08-31 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/98421 * include/std/span (span(Iter, size_type), span(Iter, Iter)): Add valid range checks. * testsuite/23_containers/span/cons_1_assert_neg.cc: New test. * testsuite/23_containers/span/co

[committed] libstdc++: Fix noexcept-specifier for std::bind_front [PR 97101]

2020-09-20 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: PR libstdc++/97101 * include/std/functional (bind_front): Fix order of parameters in is_nothrow_constructible_v specialization. * testsuite/20_util/function_objects/bind_front/97101.cc: New test. Tested powerpc64le-linux. Committed to trunk.

[committed] libstdc++: Make std::assume_aligned a constexpr function [PR 97132]

2020-09-21 Thread Jonathan Wakely via Gcc-patches
The cast from void* to T* in std::assume_aligned is not valid in a constexpr function. The optimization hint is redundant during constant evaluation anyway (the compiler can see the object and knows its alignment). Simply return the original pointer without applying the __builtin_assume_aligned hin

[committed] libstdc++: Relax constraints on transform_view and elements_view iterators

2020-09-21 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/ranges (transform_view, elements_view): Relax constraints on operator- for iterators, as per LWG 3483. * testsuite/std/ranges/adaptors/elements.cc: Check that we can take the difference of two iterators from a non-random

Re: [PATCH] libstdc++: Rebase include/pstl to current upstream

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 15/09/20 20:35 -0700, Thomas Rodgers wrote: From: Thomas Rodgers 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.

Re: [PATCH] Fix overflow handling in std::align

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 10:42 -0400, Glen Fernandes via Libstdc++ wrote: On Mon, Sep 14, 2020 at 5:44 PM Thomas Rodgers wrote: > On Sep 14, 2020, at 7:30 AM, Ville Voutilainen wrote: > > On Mon, 14 Sep 2020 at 15:49, Glen Fernandes wrote: >> Sounds like a good idea. Updated patch attached. > > Looks good

Re: [PATCH] libstdc++: Mark some more algorithms constexpr for C++20

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 18/09/20 21:08 -0400, Patrick Palka via Libstdc++ wrote: As per P0202. Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (for_each_n): Mark constexpr for C++20. (search): Likewise for the overload that takes a searcher. * testsuite/25_a

Re: [PATCH] libstdc++: Fix division by zero in std::sample

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 18/09/20 21:08 -0400, Patrick Palka via Libstdc++ wrote: This fixes a division by zero in the selection-sampling std::__search overload when the input range is empty (and hence __unsampled_sz is 0). Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (__

Re: [PATCH] libstdc++: Rebase include/pstl to current upstream

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 08:19 -0700, Thomas Rodgers wrote: On Sep 21, 2020, at 7:40 AM, Jonathan Wakely wrote: On 15/09/20 20:35 -0700, Thomas Rodgers wrote: From: Thomas Rodgers From llvm-project/pstl @ 0b2e0e80d96 libstdc++-v3/ChangeLog: * include/pstl/algorithm_impl.h: Update file.

Re: [PATCH] libstdc++: Remove overzealous static_asserts from std::span

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 15:07 -0400, Patrick Palka via Libstdc++ wrote: On Mon, 21 Sep 2020, Patrick Palka wrote: For a span with empty static extent, we currently model the preconditions of front(), back(), and operator[] as if they were mandates, by using a static_assert to verify that extent != 0. This

[committed] libstdc++: Fix constraints for drop_view::begin() const [LWG 3482]

2020-09-21 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/ranges (drop_view::begin()): Adjust constraints to match the correct condition for O(1) ranges::next (LWG 3482). * testsuite/std/ranges/adaptors/drop.cc: Check that iterator is cached for non-sized_range. Tested powerpc64le-lin

[committed] libstdc++: Use __builtin_expect in __glibcxx_assert

2020-09-21 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/c++config (__replacement_assert): Add noreturn attribute. (__glibcxx_assert_impl): Use __builtin_expect to hint that the assertion is expected to pass. Tested powerpc64le-linux. Committed to trunk. commit 7db5967f1050eb2b45e9

Re: [committed] libstdc++: Use correct argument type for __use_alloc [PR 96803]

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 26/08/20 19:34 +0100, Jonathan Wakely wrote: The _Tuple_impl constructor for allocator-extended construction from a different tuple type uses the _Tuple_impl's own _Head type in the __use_alloc test. That is incorrect, because the argument tuple could have a different type. Using the wrong typ

Re: [PATCH] libstdc++: use a link test to test for -Wl,-z,relro

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 16/09/20 12:11 +, JonY via Libstdc++ wrote: On 9/13/20 3:37 PM, JonY wrote: On 9/10/20 2:23 PM, JonY wrote: Do a link test instead of just a grep. The linker can support multiple targets, but not all targets can use it. Cygwin/MinGW ld can support ELF but the PE format for Windows itsel

Re: [PATCH] libstdc++: use a link test to test for -Wl,-z,relro

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 22/09/20 09:40 +, JonY via Libstdc++ wrote: On 9/22/20 8:50 AM, Jonathan Wakely wrote: I don't see a patch, or any previous email to the libstdc++ list. Please resend with the patch, CCing libstdc++@ Thanks. Resent for the record. Thanks. I've been told it might not be appropr

Re: [PATH 3/3] libstdc++: Add std::advance ostreambuf_iterator overload

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 14/09/20 22:36 +0200, François Dumont via Libstdc++ wrote: On 10/09/20 5:19 pm, Jonathan Wakely wrote: On 09/09/20 22:12 +0200, François Dumont via Libstdc++ wrote: libstdc++: Add std::advance overload for ostreambuf_iterator Implement std::advance overload for ostreambuf_iterator using

Re: [PATCH] libstdc++: Pretty printers for std::_Bit_reference, std::_Bit_iterator and std::_Bit_const_iterator

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 14/09/20 16:49 +0200, Michael Weghorn via Libstdc++ wrote: Hi, the attached patch implements pretty printers relevant for iteration over std::vector, thus handling the TODO added in commit 36d0dada6773d7fd7c5ace64c90e723930a3b81e ("Have std::vector printer's iterator return bool for vector",

[committed] libstdc++: Introduce new headers for C++20 ranges components

2020-09-22 Thread Jonathan Wakely via Gcc-patches
This introduces two new headers: defines the minimal components needed for using C++20 ranges (customization point objects such as std::ranges::begin, concepts such as std::ranges::range, etc.) includes and additionally defines subrange, which is needed by . Most of the content of was previo

Re: [PATCH] Fix overflow handling in std::align

2020-09-22 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 15:50 +0100, Jonathan Wakely wrote: On 21/09/20 10:42 -0400, Glen Fernandes via Libstdc++ wrote: On Mon, Sep 14, 2020 at 5:44 PM Thomas Rodgers wrote: On Sep 14, 2020, at 7:30 AM, Ville Voutilainen wrote: On Mon, 14 Sep 2020 at 15:49, Glen Fernandes wrote: Sounds like a good id

[committed] libstdc++: Fix out-of-bounds string_view access in filesystem::path [PR 97167]

2020-09-22 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: PR libstdc++/97167 * src/c++17/fs_path.cc (path::_Parser::root_path()): Check for empty string before inspecting the first character. * testsuite/27_io/filesystem/path/append/source.cc: Append empty string_view to path. Tested powerp

Re: [PATCH] PR libstdc++/71579 assert that type traits are not misused with an incomplete type

2020-09-24 Thread Jonathan Wakely via Gcc-patches
On 24/09/20 10:15 +0300, Antony Polukhin via Libstdc++ wrote: Looks like the last patch was not applied. Do I have to change something in it? No, it just hasn't been reviewed yet.

Re: [PATCH] add move CTOR to auto_vec, use auto_vec for get_loop_exit_edges

2020-09-24 Thread Jonathan Wakely via Gcc-patches
On 24/09/20 11:11 +0200, Richard Biener wrote: On Wed, 26 Aug 2020, Richard Biener wrote: On Thu, 6 Aug 2020, Richard Biener wrote: > On Thu, 6 Aug 2020, Richard Biener wrote: > > > This adds a move CTOR to auto_vec and makes use of a > > auto_vec return value for get_loop_exit_edges denoting

Re: [PATCH] libstdc++: Specialize ranges::__detail::__box for semiregular types

2020-09-24 Thread Jonathan Wakely via Gcc-patches
On 24/09/20 09:04 -0400, Patrick Palka via Libstdc++ wrote: The class template semiregular-box defined in [range.semi.wrap] is used by a number of views to accomodate non-semiregular subobjects while ensuring that the overall view remains semiregular. It provides a stand-in default constructor,

[committed] libstdc++: Fix misnamed configure option in manual

2020-09-24 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * doc/xml/manual/configure.xml: Correct name of option. * doc/html/*: Regenerate. Committed to trunk. commit 61f7995398a719f2ff91d07e8f8ed6d4413db697 Author: Jonathan Wakely Date: Thu Sep 24 17:33:16 2020 libstdc++: Fix misnamed configure option in

Re: [PATCH] PR libstdc++/71579 assert that type traits are not misused with an incomplete type

2020-09-24 Thread Jonathan Wakely via Gcc-patches
On 20/08/20 18:31 +0300, Antony Polukhin via Libstdc++ wrote: ср, 19 авг. 2020 г. в 14:29, Jonathan Wakely : <...> Do we also want to check (std::__is_complete_or_unbounded(__type_identity<_ArgTypes>{}) && ...) for invoke_result and the is_invocable traits? Done. Changelog: 2020-08-20 Anton

[committed] libstdc++: Remove redundant -std=gnu++1z flags from makefile

2020-09-25 Thread Jonathan Wakely via Gcc-patches
Now that G++ defaults to gnu++17 we don't need special rules for compiling the C++17 allocation and deallocation functions. libstdc++-v3/ChangeLog: * libsupc++/Makefile.am: Remove redundant -std=gnu++1z flags. * libsupc++/Makefile.in: Regenerate. Tested powerpc64le-linux. Committ

[committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-09-26 Thread Jonathan Wakely via Gcc-patches
Glibc 2.32 adds a global variable that says whether the process is single-threaded. We can use this to decide whether to elide atomic operations, as a more precise and reliable indicator than __gthread_active_p. This means that guard variables for statics and reference counting in shared_ptr can u

Re: [PATCH 1/4] libstdc++: Reduce the size of an unbounded iota_view

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 00:48 -0400, Patrick Palka via Libstdc++ wrote: libstdc++-v3/ChangeLog: * include/std/ranges (iota_view::_M_bound): Give it [[no_unique_address]]. * testsuite/std/ranges/iota/iota_view.cc: Check that an unbounded iota_view has minimal size. OK. lib

Re: [PATCH 2/4] libstdc++: Reduce the size of a subrange with empty sentinel type

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 00:48 -0400, Patrick Palka via Libstdc++ wrote: libstdc++-v3/ChangeLog: * include/bits/ranges_util.h (subrange::_M_end): Give it [[no_unique_adcress]]. * testsuite/std/ranges/subrange/sizeof.cc: New test. OK. libstdc++-v3/include/bits/ranges_util.h |

Re: [PATCH 3/4] libstdc++: Add test that tracks range adaptors' sizes

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 00:48 -0400, Patrick Palka via Libstdc++ wrote: libstdc++-v3/ChangeLog: * testsuite/std/ranges/adaptors/sizeof.cc: New test. OK. .../testsuite/std/ranges/adaptors/sizeof.cc | 49 +++ 1 file changed, 49 insertions(+) create mode 100644 libstdc++-v3/testsui

Re: [PATCH 4/4] libstdc++: Rearrange some range adaptors' data members

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 00:48 -0400, Patrick Palka via Libstdc++ wrote: Since the standard range adaptors are specified to derive from the empty class view_base, making their first data member store the underlying view is suboptimal, for if the underlying view also derives from view_base then the two view_ba

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 16:58 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch supercedes both the Add C++2a synchronization support patch being replied to *and* the patch adding wait/notify_* to atomic_flag. Add support for - * atomic_flag::wait/notify_one/notify_all * atomic::wait/notify_o

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 16:58 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch supercedes both the Add C++2a synchronization support patch being replied to *and* the patch adding wait/notify_* to atomic_flag. Add support for - * atomic_flag::wait/notify_one/notify_all * atomic::wait/notify_o

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 16:58 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch supercedes both the Add C++2a synchronization support patch being replied to *and* the patch adding wait/notify_* to atomic_flag. Add support for - * atomic_flag::wait/notify_one/notify_all * atomic::wait/notify_o

Re: [PATCH 4/4] libstdc++: Rearrange some range adaptors' data members

2020-09-28 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 09:11 -0400, Patrick Palka via Libstdc++ wrote: On Mon, 28 Sep 2020, Jonathan Wakely wrote: On 28/09/20 00:48 -0400, Patrick Palka via Libstdc++ wrote: > Since the standard range adaptors are specified to derive from the empty > class view_base, making their first data member store

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-09-29 Thread Jonathan Wakely via Gcc-patches
On 28/09/20 14:29 -0700, Thomas Rodgers wrote: +template + __atomic_wait_status + __platform_wait_until_impl(__platform_wait_t* __addr, +__platform_wait_t __val, +const chrono::time_point<__platform_wait_clock_t, +

Re: [PATCH] c++: Diagnose visitors with different return types for std::visit [PR95904]

2020-09-29 Thread Jonathan Wakely via Gcc-patches
On 29/09/20 01:12 +0300, Ville Voutilainen via Libstdc++ wrote: Not completely tested yet. This does fix the problem of converting incompatible pointer-to-function types, and thus gets rid of the suggestion that compiling the code with -fpermissive is a possibility. There is a special-casing for

Re: [committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-09-30 Thread Jonathan Wakely via Gcc-patches
On 29/09/20 13:51 +0200, Christophe Lyon via Libstdc++ wrote: On Sat, 26 Sep 2020 at 21:42, Jonathan Wakely via Gcc-patches wrote: Glibc 2.32 adds a global variable that says whether the process is single-threaded. We can use this to decide whether to elide atomic operations, as a more

[committed] libstdc++: Use __is_same instead of __is_same_as

2020-09-30 Thread Jonathan Wakely via Gcc-patches
PR 92271 added __is_same as another spelling of __is_same_as. Since Clang also spells it __is_same, let's just use that consistently. It appears that Intel icc sets __GNUC__ to 10, but only supports __is_same_as. If we only use __is_same for __GNUC__ >= 11 then we won't break icc again (it looks l

Re: [PATCH] libstdc++: Rebase include/pstl to current upstream

2020-09-30 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 15:40 +0100, Jonathan Wakely wrote: On 15/09/20 20:35 -0700, Thomas Rodgers wrote: From: Thomas Rodgers From llvm-project/pstl @ 0b2e0e80d96 libstdc++-v3/ChangeLog: * include/pstl/algorithm_impl.h: Update file. * include/pstl/execution_impl.h: Likewise. *

Re: [committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-09-30 Thread Jonathan Wakely via Gcc-patches
On 30/09/20 16:03 +0100, Jonathan Wakely wrote: On 29/09/20 13:51 +0200, Christophe Lyon via Libstdc++ wrote: On Sat, 26 Sep 2020 at 21:42, Jonathan Wakely via Gcc-patches wrote: Glibc 2.32 adds a global variable that says whether the process is single-threaded. We can use this to decide

Re: [committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-10-01 Thread Jonathan Wakely via Gcc-patches
On 01/10/20 09:30 +0200, Christophe Lyon via Libstdc++ wrote: On Wed, 30 Sep 2020 at 22:44, Jonathan Wakely wrote: On 30/09/20 16:03 +0100, Jonathan Wakely wrote: >On 29/09/20 13:51 +0200, Christophe Lyon via Libstdc++ wrote: >>On Sat, 26 Sep 2020 at 21:42, Jonathan Wakely via Gc

Re: [committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-10-01 Thread Jonathan Wakely via Gcc-patches
2020 at 21:42, Jonathan Wakely via Gcc-patches wrote: Glibc 2.32 adds a global variable that says whether the process is single-threaded. We can use this to decide whether to elide atomic operations, as a more precise and reliable indicator than __gthread_active_p. This means that guard variables

Re: [PATCH] libstdc++: Add missing P0896 changes to

2020-10-02 Thread Jonathan Wakely via Gcc-patches
On 01/10/20 10:35 -0400, Patrick Palka via Libstdc++ wrote: I noticed that the following changes from this paper were not yet implemented. Oops, thanks. OK to commit after testing on x86_64-pc-linux-gnu finishes successfully? libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (re

[PATCH] testsuite: Fix FAIL for older ARM cores

2020-10-02 Thread Jonathan Wakely via Gcc-patches
Since hard-float is not implemented for cores that only support thumb1 (and not thumb2) this test fails for configurations using hard float but older -mcpu settings. gcc/testsuite/ChangeLog: * g++.dg/inherit/thunk10.C: Skip test for arm_hf_eabi if -mthumb doesn't generate thumb2 i

Re: [PATCH 1/2] system_data_types.7: Add 'void *'

2020-10-02 Thread Jonathan Wakely via Gcc-patches
On Fri, 2 Oct 2020 at 13:17, Alejandro Colomar wrote: > > Signed-off-by: Alejandro Colomar > > system_data_types.7: void *: Add info about generic function parameters and > return value > > Reported-by: Paul Eggert > Reported-by: David Laight > Signed-off-by: Alejandro Colomar > > system_data

Re: [committed] libstdc++: Use __libc_single_threaded to optimise atomics [PR 96817]

2020-10-02 Thread Jonathan Wakely via Gcc-patches
On 26/09/20 20:42 +0100, Jonathan Wakely wrote: Glibc 2.32 adds a global variable that says whether the process is single-threaded. We can use this to decide whether to elide atomic operations, as a more precise and reliable indicator than __gthread_active_p. This means that guard variables for

[committed] libstdc++: Change test to work without 64-bit atomics

2020-10-02 Thread Jonathan Wakely via Gcc-patches
This fixes a linker error for older ARM cores without 64-bit atomics. I think the { dg-add-options libatomic } is no longer needed, but it's harmless to keep it there. libstdc++-v3/ChangeLog: * testsuite/29_atomics/atomic_float/value_init.cc: Use float instead of double so that _

Re: This is my patch for fstream to fix the performance issue on Windows.

2020-10-02 Thread Jonathan Wakely via Gcc-patches
On 01/10/20 03:29 +, sotrdg sotrdg via Libstdc++ wrote: From fb8d644a4c315058af141a3e84fcc083d665c8b9 Mon Sep 17 00:00:00 2001 From: ejsvifq_mabmip Date: Wed, 30 Sep 2020 23:26:47 -0400 Subject: [PATCH] Fix a long term performance issue of fstream on Windows since MSVCRT defines BUFSIZ as 51

Re: [PATCH] libstdc++: Diagnose visitors with different return types [PR95904]

2020-10-02 Thread Jonathan Wakely via Gcc-patches
On 29/09/20 19:35 +0300, Ville Voutilainen via Libstdc++ wrote: On Tue, 29 Sep 2020 at 14:20, Jonathan Wakely wrote: I think this is what we want: template constexpr inline __same_types = (is_same_v<_Tp, _Types> && ...); is_same_v is very cheap, it uses the built-in directly, so you d

Re: libstdc++: Fix chrono::__detail::ceil to work with C++11 (was Re: [PATCH v5 6/8] libstdc++ atomic_futex: Avoid rounding errors in std::future::wait_* [PR91486])

2020-10-05 Thread Jonathan Wakely via Gcc-patches
On 19/09/20 11:37 +0100, Mike Crowe wrote: On Friday 11 September 2020 at 19:59:36 +0100, Jonathan Wakely wrote: commit 53ad6b1979f4bd7121e977c4a44151b14d8a0147 Author: Jonathan Wakely Date: Fri Sep 11 19:59:11 2020 libstdc++: Fix chrono::__detail::ceil to work with C++11 In C++11 c

Re: [PATCH v5 6/8] libstdc++ atomic_futex: Avoid rounding errors in std::future::wait_* [PR91486]

2020-10-05 Thread Jonathan Wakely via Gcc-patches
On 19/09/20 11:50 +0100, Mike Crowe wrote: On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: > > diff --git a/libstdc++-v3/include/bits/atomic_futex.h b/libstdc++-v3/include/bits/atomic_futex.h > > index 5f95ade..aa137a7 100644 > > --- a/libstdc++-v3/include/bits/atomic_futex.h > > +++ b

[committed] libstdc++: Make allocators throw bad_array_new_length on overflow [LWG 3190]

2020-10-05 Thread Jonathan Wakely via Gcc-patches
std::allocator and std::pmr::polymorphic_allocator should throw std::bad_array_new_length from their allocate member functions if the number of bytes required cannot be represented in std::size_t. libstdc++-v3/ChangeLog: * config/abi/pre/gnu.ver: Add new symbol. * include/bits/fun

[committed] libstdc++: Minor header cleanup in

2020-10-05 Thread Jonathan Wakely via Gcc-patches
When adding new features to I included the required headers adjacent to the new code. This cleans it up by moving all the includes to the start of the file. libstdc++-v3/ChangeLog: * include/std/numeric: Move all #include directives to the top of the header. * testsuite/2

[committed] libstdc++: Reduce uses of std::numeric_limits

2020-10-05 Thread Jonathan Wakely via Gcc-patches
This avoids unnecessary instantiations of std::numeric_limits or inclusion of when a more lightweight alternative would work. Some uses can be replaced with __gnu_cxx::__int_traits and some can just use size_t(-1) directly where SIZE_MAX is needed. libstdc++-v3/ChangeLog: * include/bits/

Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-05 Thread Jonathan Wakely via Gcc-patches
I'm sorry it's taken a year to review this properly. Comments below ... On 27/09/19 14:18 -0400, Daniel Lemire wrote: (This is a revised patch proposal. I am revising both the description and the code itself.) Even on recent processors, integer division is relatively expensive. The current impl

<    2   3   4   5   6   7   8   9   10   11   >