[committed] libstdc++: Implement std::emit_on_flush etc.

2020-11-10 Thread Jonathan Wakely via Gcc-patches
This adds the manipulators for use with basic_osyncstream. In order to detect when an arbitrary basic_ostream is the base class of a basic_syncbuf object, introduce a new intermediate base class that stores the data members. The new base class stores a pointer and two bools, which wastes (sizeof(vo

[committed] libstdc++: Use helper type for checking thread ID

2020-11-11 Thread Jonathan Wakely via Gcc-patches
This encapsulates the storing and checking of the thread ID into a class type, so that the macro _GLIBCXX_HAS_GTHREADS is only checked in one place. The code doing the checks just calls member functions of the new type, without caring whether that really does any work or not. libstdc++-v3/ChangeLo

Re: std::jthread::operator=(std::jthread&&) calls std::terminate if *this has an associated running thread.

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 08/11/20 14:51 +0100, Paul Scharnofske via Libstdc++ wrote: I think this would work: jthread& operator=(jthread&& __x) noexcept { std::jthread(std::move(__x)).swap(*this); return *this; } That looks a lot better than what I did, it's also consistent with other places like std:

Re: [PATCH] libstdc++: exclude cygwin/mingw from relro linker test

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 12:34 +, Jonathan Yong via Libstdc++ wrote: cygwin/mingw hosted linker may support multiple targets with ELF relro support. This breaks configure testing. Attached patch excludes cygwin/mingw PE format from relro linker flag. Patch OK? OK, thanks. From a72f02aec065c312528e4

Re: [PATCH] libstdc++: exclude cygwin/mingw from relro linker test

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 12:41 +, Jonathan Wakely wrote: On 11/11/20 12:34 +, Jonathan Yong via Libstdc++ wrote: cygwin/mingw hosted linker may support multiple targets with ELF relro support. This breaks configure testing. Attached patch excludes cygwin/mingw PE format from relro linker flag. Pat

[PATCH] libstdc++: Enable without gthreads

2020-11-11 Thread Jonathan Wakely via Gcc-patches
This makes it possible to use std::thread in single-threaded builds. All member functions are available, but attempting to create a new thread will throw an exception. The main benefit for most targets is that other headers such as do not need to include the whole of just to be able to create a

[PATCH] libstdc++: Ensure __gthread_self doesn't call undefined weak symbol [PR 95989]

2020-11-11 Thread Jonathan Wakely via Gcc-patches
Since glibc 2.27 the pthread_self symbol has been defined in libc rather than libpthread. Because we only call pthread_self through a weak alias it's possible for statically linked executables to end up without a definition of pthread_self. This crashes when trying to call an undefined weak symbol.

Re: [PATCH] libstdc++: Enable without gthreads

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 16:13 +, Jonathan Wakely wrote: This makes it possible to use std::thread in single-threaded builds. All member functions are available, but attempting to create a new thread will throw an exception. The main benefit for most targets is that other headers such as do not need to

Re: [PATCH] libstdc++: Ensure __gthread_self doesn't call undefined weak symbol [PR 95989]

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 19:08 +0100, Jakub Jelinek via Libstdc++ wrote: On Wed, Nov 11, 2020 at 05:24:42PM +, Jonathan Wakely wrote: --- a/libgcc/gthr-posix.h +++ b/libgcc/gthr-posix.h @@ -684,7 +684,14 @@ __gthread_equal (__gthread_t __t1, __gthread_t __t2) static inline __gthread_t __gthread_self (v

[PATCH] libstdc++: Add C++ runtime support for new 128-bit long double format

2020-11-11 Thread Jonathan Wakely via Gcc-patches
This adds support for the new __ieee128 long double format on powerpc64le targets. Most of the complexity comes from wanting a single libstdc++.so library that contains the symbols needed by code compiled with both -mabi=ibmlongdouble and -mabi=ieeelongdouble (and not forgetting -mlong-double-64 a

Re: [PATCH] std::experimental::simd

2020-11-11 Thread Jonathan Wakely via Gcc-patches
On 08/05/20 21:03 +0200, Matthias Kretz wrote: Here's my last update to the std::experimental::simd patch. It's currently based on the gcc-10 branch. + +// __next_power_of_2{{{ +/** + * \internal We use @foo for Doxygen commens rather than \foo + * Returns the next power of 2 larger than

[committed] libstdc++: Fix __numeric_traits_integer<__int20> [PR 97798]

2020-11-12 Thread Jonathan Wakely via Gcc-patches
The expression used to calculate the maximum value for an integer type assumes that the number of bits in the value representation is always sizeof(T) * CHAR_BIT. This is not true for the __int20 type on msp430, which has only 20 bits in the value representation but 32 bits in the object representa

Re: [committed] libstdc++: Fix __numeric_traits_integer<__int20> [PR 97798]

2020-11-12 Thread Jonathan Wakely via Gcc-patches
Here's a small tweak to __numeric_traits that I decided to do after the previous patch. Tested on powerpc64le-linux. Committed to trunk. commit d21776ef90361e66401cd99c8ff0d98b46d3b0d6 Author: Jonathan Wakely Date: Thu Nov 12 13:31:02 2020 libstdc++: Simplify __numeric_traits definition

Re: [PATCH] libstdc++: Enable without gthreads

2020-11-12 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 17:31 +, Jonathan Wakely wrote: On 11/11/20 16:13 +, Jonathan Wakely wrote: This makes it possible to use std::thread in single-threaded builds. All member functions are available, but attempting to create a new thread will throw an exception. The main benefit for most targe

Re: [PATCH] libstdc++: Add support for C++20 barriers

2020-11-12 Thread Jonathan Wakely via Gcc-patches
On 04/11/20 10:55 -0800, Thomas Rodgers wrote: --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -603,13 +603,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #if __cplusplus > 201703L + template + _GLIBCXX_ALWAYS_INLINE void + _M_wait(_

Re: [PATCH] libstdc++: Ensure __gthread_self doesn't call undefined weak symbol [PR 95989]

2020-11-12 Thread Jonathan Wakely via Gcc-patches
On 11/11/20 19:08 +0100, Jakub Jelinek via Libstdc++ wrote: On Wed, Nov 11, 2020 at 05:24:42PM +, Jonathan Wakely wrote: --- a/libgcc/gthr-posix.h +++ b/libgcc/gthr-posix.h @@ -684,7 +684,14 @@ __gthread_equal (__gthread_t __t1, __gthread_t __t2) static inline __gthread_t __gthread_self (v

Re: [PATCH v5 2/8] libstdc++ futex: Use FUTEX_CLOCK_REALTIME for wait

2020-11-12 Thread Jonathan Wakely via Gcc-patches
On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: The futex system call supports waiting for an absolute time if FUTEX_WAIT_BITSET is used rather than FUTEX_WAIT. Doing so provides two benefits: 1. The call to gettimeofday is not required in order to calculate a relative timeout. 2. I

[committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-12 Thread Jonathan Wakely via Gcc-patches
To poll a std::future to see if it's ready you have to call one of the timed waiting functions. The most obvious way is wait_for(0s) but this was previously very inefficient because it would turn the relative timeout to an absolute one by calling system_clock::now(). When the relative timeout is ze

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 12/11/20 23:49 +, Jonathan Wakely wrote: To poll a std::future to see if it's ready you have to call one of the timed waiting functions. The most obvious way is wait_for(0s) but this was previously very inefficient because it would turn the relative timeout to an absolute one by calling sy

[PATCH] libstdc++: Fix error shown during Solaris build

2020-11-13 Thread Jonathan Wakely via Gcc-patches
Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments. The arguments are passed by this make rule: perl ${glibcxx_srcdir}/scripts/make_exports.pl \

Re: [PATCH] libstdc++: Fix error shown during Solaris build

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 11:07 +, Jonathan Wakely wrote: Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments. The arguments are passed by this make rule: perl $

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 11:02 +, Jonathan Wakely wrote: On 12/11/20 23:49 +, Jonathan Wakely wrote: To poll a std::future to see if it's ready you have to call one of the timed waiting functions. The most obvious way is wait_for(0s) but this was previously very inefficient because it would turn the

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
>Backporting the change to gcc-10 revealed an overflow bug in the >existing code, resulting in blocking for years when given an absolute >timeout in the distant past. There's still a similar bug in the new >code (using futexes with absolute timeouts against clocks) where a >large chrono::seconds va

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 20:29 +, Mike Crowe via Libstdc++ wrote: On Friday 13 November 2020 at 17:25:22 +, Jonathan Wakely wrote: + // Return the relative duration from (now_s + now_ns) to (abs_s + abs_ns) + // as a timespec. + struct timespec + relative_timespec(chrono::seconds abs_s, chrono::n

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 21:12 +, Jonathan Wakely wrote: On 13/11/20 20:29 +, Mike Crowe via Libstdc++ wrote: On Friday 13 November 2020 at 17:25:22 +, Jonathan Wakely wrote: + // Return the relative duration from (now_s + now_ns) to (abs_s + abs_ns) + // as a timespec. + struct timespec + r

Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single

2020-11-13 Thread Jonathan Wakely via Gcc-patches
>> "Jakub" == Jakub Jelinek via Gcc-patches >> writes: > >Jakub> * c-cppbuiltin.c: Include configargs.h. >Jakub> (c_cpp_builtins): For C++11 and later if THREAD_MODEL_SPEC is >not >Jakub> defined, predefine __STDCPP_THREADS__ to 1 unless thread_model >is >Jakub>

Re: [PATCH v5 2/8] libstdc++ futex: Use FUTEX_CLOCK_REALTIME for wait

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 21:58 +, Mike Crowe via Libstdc++ wrote: On Thursday 12 November 2020 at 23:07:47 +, Jonathan Wakely wrote: On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: > The futex system call supports waiting for an absolute time if > FUTEX_WAIT_BITSET is used rather than FUTEX_

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 21:12 +, Jonathan Wakely wrote: On 13/11/20 20:29 +, Mike Crowe via Libstdc++ wrote: On Friday 13 November 2020 at 17:25:22 +, Jonathan Wakely wrote: + // Return the relative duration from (now_s + now_ns) to (abs_s + abs_ns) + // as a timespec. + struct timespec + r

Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 22:46 +0100, Jakub Jelinek wrote: On Fri, Nov 13, 2020 at 04:39:25PM -0500, Jason Merrill wrote: On 11/13/20 2:20 PM, Tom Tromey wrote: > > > > > > "Jakub" == Jakub Jelinek via Gcc-patches writes: > > Jakub> 2020-11-13 Jakub Jelinek > > Jakub> * c-cppbuiltin.c: Include configar

Re: [committed] libstdc++: Optimise std::future::wait_for and fix futex polling

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 13/11/20 22:45 +, Jonathan Wakely wrote: On 13/11/20 21:12 +, Jonathan Wakely wrote: On 13/11/20 20:29 +, Mike Crowe via Libstdc++ wrote: On Friday 13 November 2020 at 17:25:22 +, Jonathan Wakely wrote: + // Return the relative duration from (now_s + now_ns) to (abs_s + abs

[committed] libstdc++: Use custom timespec in system calls [PR 93421]

2020-11-13 Thread Jonathan Wakely via Gcc-patches
On 32-bit targets where userspace has switched to 64-bit time_t, we cannot pass struct timespec to SYS_futex or SYS_clock_gettime, because the userspace definition of struct timespec will not match what the kernel expects. We use the existence of the SYS_futex_time64 or SYS_clock_gettime_time64 ma

Re: [committed] libstdc++: Use custom timespec in system calls [PR 93421]

2020-11-14 Thread Jonathan Wakely via Gcc-patches
On Sat, 14 Nov 2020, 13:30 Mike Crowe via Libstdc++, wrote: > On Saturday 14 November 2020 at 00:17:59 +, Jonathan Wakely via > Libstdc++ wrote: > > On 32-bit targets where userspace has switched to 64-bit time_t, we > > cannot pass struct timespec to SYS_futex or SYS_clock_gettime, because >

Re: [PATCH] libstdc++: Fix error shown during Solaris build

2020-11-16 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 11:23 +0100, Rainer Orth wrote: Hi Jonathan, But in practice the snippet above is only used if you explicitly configure with --enable-libstdcxx-time={yes,rt} and will only add anything to GLIBCXX_LIBS if clock_gettime or nanosleep lives in one of librt or libposix4. I think libposix

Re: [PATCH] libstdc++: Fix error shown during Solaris build

2020-11-16 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 11:17 +0100, Rainer Orth wrote: Hi Jonathan, Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments. The arguments are passed by this make rule:

Re: [PATCH] libstdc++: Fix error shown during Solaris build

2020-11-16 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 10:32 +, Jonathan Wakely wrote: On 16/11/20 11:17 +0100, Rainer Orth wrote: Hi Jonathan, Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments.

Re: [PATCH] libstdc++: Fix error shown during Solaris build

2020-11-16 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 12:46 +0100, Rainer Orth wrote: Hi Jonathan, libstdc++-v3/ChangeLog: * src/Makefile.am (libstdc++-symbols.ver-sun): Remove -lrt from arguments passed to make_sunver.pl script. * src/Makefile.in: Regenerate. Tested sparc-solaris2.11. Rainer, does this look O

Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single

2020-11-16 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 09:23 -0700, Tom Tromey wrote: Jakub> If it is done in the library, it will be defined only if any of the library Jakub> headers are included. Jakub> The https://eel.is/c++draft/cpp.predefined wording doesn't look like it Jakub> would allow defining it only if certain headers are inc

[PATCH] libstdc++ Disable bogus -fsanitize=integer errors from Clang

2020-11-16 Thread Jonathan Wakely via Gcc-patches
Clang's "unsigned integer overflow" sanitizer can't tell the difference between expected unsigned wraparound and a bug, and its developers tell users to report bugs against libstdc++. This disables the sanitizer where we are intentionally relying on wraparound working as defined by the standard.

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

2021-09-01 Thread Jonathan Wakely via Gcc-patches
On Wed, 1 Sept 2021 at 02:44, Jonathan Yong <10wa...@gmail.com> wrote: > > On 8/31/21 9:02 AM, Jonathan Wakely wrote: > > 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

[committed] libstdc++: Define std::invoke_r for C++23 (P2136R3)

2021-09-02 Thread Jonathan Wakely via Gcc-patches
We already supported this feature as std::__invoke, for internal use. This just adds a public version of it to . Internal uses should continue to include and use std::__invoke so that they don't need to include all of . Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/

[committed] libstdc++: Remove "no stronger" assertion in compare exchange [PR102177]

2021-09-02 Thread Jonathan Wakely via Gcc-patches
P0418R2 removed some preconditions from std::atomic::compare_exchange_* but we still enforce them via __glibcxx_assert. This removes those assertions. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR c++/102177 * include/bits/atomic_base.h (__is_valid_cmpexch_failure_or

[committed] libstdc++: Tweak whitespace in

2021-09-02 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/atomic: Tweak whitespace. Tested x86_64-linux. Committed to trunk. commit 892400f1f21ccee98dddcd90677038ce266248c8 Author: Jonathan Wakely Date: Thu Sep 2 16:08:25 2021 libstdc++: Tweak whitespace in

[committed] libstdc++: Implement std::atomic::compare_exchange_weak

2021-09-02 Thread Jonathan Wakely via Gcc-patches
For some reason r170217 didn't add compare_exchange_weak to the __atomic_base partial specialization, and so weak compare exchange operations on pointers use compare_exchange_strong instead. This adds __atomic_base::compare_exchange_weak and then uses it in std::atomic::compare_exchange_weak. Sig

[PATCH] libstdc++: Define macro before it is first checked

2021-09-02 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (_GLIBCXX_HAVE_PLATFORM_WAIT): Define before first attempt to check it. Tested x86_64-linux and powerpc64-linux, not committed yet. I think we need this, otherwise __platform_wait_uses_type is f

Re: [PATCH] libstdc++: Define macro before it is first checked

2021-09-02 Thread Jonathan Wakely via Gcc-patches
On Thu, 2 Sept 2021 at 19:00, Jonathan Wakely wrote: > > * include/bits/atomic_wait.h (_GLIBCXX_HAVE_PLATFORM_WAIT): > Define before first attempt to check it. > > Tested x86_64-linux and powerpc64-linux, not committed yet. Actually ignore that ... I tested the wrong patch. This on

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

2021-09-08 Thread Jonathan Wakely via Gcc-patches
Ping (and remember to CC a maintainer this time). On 31/08/21 09:53 +0100, Jonathan Wakely wrote: 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 l

[committed] libstdc++: Use "test.invalid." for invalid hostname

2021-09-10 Thread Jonathan Wakely via Gcc-patches
This avoids test.invalid.some.domain being successfully resolved. libstdc++-v3/ChangeLog: * testsuite/experimental/net/internet/resolver/ops/lookup.cc: Fix invalid hostname to only match the .invalid TLD. Tested x86_64-linux. Committed to trunk. commit 7f8af6dc82a0dac0d97fdd4d1f

Re: [PATCH] libstdc++-v3: Optimize 'to_string' with numeric_limits instead of __to_chars_len

2021-09-14 Thread Jonathan Wakely via Gcc-patches
Please CC libstdc++ patches to the libstdc++ list, or they won't get reviewed (because I don't subscribe to gcc-patches). GCC 5 does implement SSO but it's only used conditionally. Your patch uses numeric_limits unconditionally, which will result in over-allocation for COW strings. There also see

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

2021-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 1 Sept 2021 at 10:52, Jonathan Wakely wrote: > > On Wed, 1 Sept 2021 at 02:44, Jonathan Yong <10wa...@gmail.com> wrote: > > > > On 8/31/21 9:02 AM, Jonathan Wakely wrote: > > > It looks like my questions about this patch never got an answer, and > > > it never got applied. > > > > > > Coul

Re: [External] Re: [PATCH] libstdc++: Optimize 'to_string' with numeric_limits instead of __to_chars_len

2021-09-15 Thread Jonathan Wakely via Gcc-patches
N.B. Please CC *both* the libstdc++ list and the gcc-patches list, as per https://gcc.gnu.org/lists.html On Wed, 15 Sept 2021 at 14:02, 刘可 wrote: > > Thank you for your review, and I apologize for my mistake. I have updated and > tested it! Hmm, it doesn't work though. How did you test it? For

[PATCH] wwwdocs: Move inactive branches to the right section

2021-09-16 Thread Jonathan Wakely via Gcc-patches
The https://gcc.gnu.org/git.html page is a total mess, listing dozens and dozens of branches which haven't seen updates in a decade and which are under the refs/dead/heads/* are of the Git repo. This moves them all to the "Inactive" or "Merged" section, as appropriate. OK for wwwdocs? commit cb

[committed] libstdc++: Add noexcept to unique_ptr accessors

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/unique_ptr.h (__uniq_ptr_impl::_M_ptr) (__uniq_ptr_impl::_M_deleter): Add noexcept. Tested powerpc64le-linux. Committed to trunk. commit 869107c9c9752c9a53cdb06179c1e6be6d2e5f44 Author: Jonathan Wakely Date:

[committed] libstdc++: Add noexcept to std::to_string overloads that don't allocate

2021-09-16 Thread Jonathan Wakely via Gcc-patches
When the values is guaranteed to fit in the SSO buffer we know the string won't allocate, so the function can be noexcept. For 32-bit integers, we know they need no more than 9 bytes (or 10 with a minus sign) and the SSO buffer is 15 bytes. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog:

[committed] libstdc++: Fix recipes for C++11-compiled files in src/c++98

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * src/c++98/Makefile.am: Use CXXCOMPILE not LTCXXCOMPILE. * src/c++98/Makefile.in: Regenerate. Tested x86_64-linux. Committed to trunk. commit 2c351dafcbc871c088ce09ae69bc08871f7df57b Author: Jonathan Wakely Date: Wed Se

[committed] libstdc++: Add missing constraint to std::span deduction guide [PR102280]

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102280 * include/std/span (span(Range&&)): Add constraint to deduction guide. Tested x86_64-linux. Committed to trunk. commit e67917f5df9d84f5aed3513b3931a82870d25135 Author: Jonathan Wakely Date: We

[committed] libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Head_base, _Tuple_impl): Add _GLIBCXX20_CONSTEXPR to allocator-extended constructors. (tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR. * testsuite/20_util/tu

[committed] libstdc++: Remove non-deducible parameter for std::advance overload

2021-09-16 Thread Jonathan Wakely via Gcc-patches
This was just a copy and paste error. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/fs_path.h (advance): Remove non-deducible template parameter. Tested x86_64-linux. Committed to trunk. commit 21c760510d31253074577a14021fdc6ad44084b6 Author: Jonathan W

[committed] libstdc++: Add noexcept to std::nullopt_t constructor

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/optional (nullptr_t): Make constructor noexcept. Tested x86_64-linux. Committed to trunk. commit cbe705a2f749c98a5f803afeb207e175b4c9a3c3 Author: Jonathan Wakely Date: Thu Sep 16 14:14:38 2021 libstdc++: Add n

[committed] libstdc++: Update documentation that only refers to c++98 and c++11

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * doc/xml/manual/using.xml: Generalize to apply to more than just -std=c++11. * doc/html/manual/using_macros.html: Regenerate. Committed to trunk. commit bd0df30a7bc7a2e98e643cf84901e5383f83c005 Author: Jonathan Wak

[committed] libstdc++: Increase timeout factor for slow pb_ds tests

2021-09-16 Thread Jonathan Wakely via Gcc-patches
Compiling these tests still times out too often when running the testsuite with more parallel jobs than there are available cores. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/ext/pb_ds/regression/tree_map_rand.cc: Increase timeout factor to 3. * te

[committed] libstdc++: Regenerate the src/debug Makefiles as needed

2021-09-16 Thread Jonathan Wakely via Gcc-patches
When the build configuration changes and Makefiles are recreated, the src/debug/Makefile and src/debug/*/Makefile files are not recreated, because they're not managed in the usual way by automake. This can lead to build failures or surprising inconsistencies between the main and debug versions of t

Re: [PATCH] libstdc++: Fix UB in atomic_ref/wait_notify.cc [PR101761]

2021-09-16 Thread Jonathan Wakely via Gcc-patches
On Thu, 16 Sep 2021, 23:24 Thomas Rodgers, wrote: > From: Thomas Rodgers > > Remove UB in atomic_ref/wait_notify test. > > Signed-off-by: Thomas Rodgers > > libstdc++-v3/ChangeLog: > > PR libstdc++/101761 > * testsuite/29_atomics/atomic_ref/wait_notify.cc (test): Use > v

Re: [committed] libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

2021-09-17 Thread Jonathan Wakely via Gcc-patches
On 16/09/21 23:07 +0100, Jonathan Wakely wrote: Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Head_base, _Tuple_impl): Add _GLIBCXX20_CONSTEXPR to allocator-extended constructors. (tuple<>::swap(tuple&)): Add _G

[PATCH] configure: Update --help output for --with-multilib-list

2021-09-17 Thread Jonathan Wakely via Gcc-patches
The list of architectures that support the option is incomplete. gcc/ChangeLog: * configure.ac: Fix --with-multilib-list description. * configure: Regenerate. OK for trunk? commit 630dc3085cbd87a224129177870103e2c4fbf22a Author: Jonathan Wakely Date: Fri Sep 17 12:34:22 2021

[committed] libstdc++: Rename tests with incorrect extension

2021-09-17 Thread Jonathan Wakely via Gcc-patches
The libstdc++ testsuite only runs .cc files, so these two old tests have never been run. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/26_numerics/valarray/dr630-3.C: Moved to... * testsuite/26_numerics/valarray/dr630-3.cc: ...here. * testsuite/27_io

Re: [PING^2] Re: Fix 'hash_table::expand' to destruct stale Value objects

2021-09-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Sept 2021 at 13:08, Richard Biener wrote: > > On Fri, Sep 17, 2021 at 1:17 PM Thomas Schwinge > wrote: > > > > Hi! > > > > On 2021-09-10T10:00:25+0200, I wrote: > > > On 2021-09-01T19:31:19-0600, Martin Sebor via Gcc-patches > > > wrote: > > >> On 8/30/21 4:46 AM, Thomas Schwinge wr

Re: [PING^2] Re: Fix 'hash_table::expand' to destruct stale Value objects

2021-09-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Sep 2021, 16:52 Thomas Schwinge, wrote: > Hi! > > On 2021-09-17T15:03:18+0200, Richard Biener > wrote: > > On Fri, Sep 17, 2021 at 2:39 PM Jonathan Wakely > wrote: > >> On Fri, 17 Sept 2021 at 13:08, Richard Biener > >> wrote: > >> > On Fri, Sep 17, 2021 at 1:17 PM Thomas Schwinge <

[committed] libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]

2021-09-17 Thread Jonathan Wakely via Gcc-patches
Also rename the test so it actually runs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Tuple_impl): Add constexpr to constructor missed in previous patch. * testsuite/20_util/tuple/cons/102270.C: Moved to...

[committed] libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]

2021-09-17 Thread Jonathan Wakely via Gcc-patches
On 17/09/21 12:25 +0100, Jonathan Wakely wrote: On 16/09/21 23:07 +0100, Jonathan Wakely wrote: Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Head_base, _Tuple_impl): Add _GLIBCXX20_CONSTEXPR to allocator-extended cons

[committed] libstdc++: Add 'noexcept' to path::iterator members

2021-09-17 Thread Jonathan Wakely via Gcc-patches
All path::iterator operations are non-throwing. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/fs_path.h (path::iterator): Add noexcept to all member functions and friend functions. (distance): Add noexcept. (advance): Add noexcept and inli

Re: [committed] libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]

2021-09-17 Thread Jonathan Wakely via Gcc-patches
On 17/09/21 20:47 +0100, Jonathan Wakely wrote: On 17/09/21 12:25 +0100, Jonathan Wakely wrote: On 16/09/21 23:07 +0100, Jonathan Wakely wrote: Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Head_base, _Tuple_impl): Add

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Sept 2021 at 18:09, Antony Polukhin wrote: > > std::unique_ptr allows construction from std::unique_ptr of derived > type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If > std::default_delete is used with std::unique_ptr, then after such > construction a delete is called

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-23 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Sept 2021 at 18:56, Antony Polukhin wrote: > > ср, 22 сент. 2021 г. в 20:44, Jonathan Wakely : > > > > On Wed, 22 Sept 2021 at 18:09, Antony Polukhin wrote: > > > > > > std::unique_ptr allows construction from std::unique_ptr of derived > > > type as per [unique.ptr.single.asgn] and [un

Re: [PATCH] wwwdocs: Move inactive branches to the right section

2021-09-23 Thread Jonathan Wakely via Gcc-patches
On 16/09/21 15:41 +0100, Jonathan Wakely wrote: The https://gcc.gnu.org/git.html page is a total mess, listing dozens and dozens of branches which haven't seen updates in a decade and which are under the refs/dead/heads/* are of the Git repo. This moves them all to the "Inactive" or "Merged" sec

Re: [PATCH] configure: Update --help output for --with-multilib-list

2021-09-23 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Sept 2021 at 23:19, Jim Wilson wrote: > On Fri, Sep 17, 2021 at 4:39 AM Jonathan Wakely via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > >> The list of architectures that support the option is incomplete. >> >> gcc/ChangeLog: >> >>

Re: [PATCH] configure: Update --help output for --with-multilib-list

2021-09-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Sept 2021 at 11:36, Jonathan Wakely wrote: > On Wed, 22 Sept 2021 at 23:19, Jim Wilson wrote: > >> On Fri, Sep 17, 2021 at 4:39 AM Jonathan Wakely via Gcc-patches < >> gcc-patches@gcc.gnu.org> wrote: >> >>> The list of architectures that suppor

[committed] libstdc++: std::system_category should know meaning of zero [PR102425]

2021-09-23 Thread Jonathan Wakely via Gcc-patches
Although 0 is not an errno value, it should still be recognized as corresponding to a value belonging to the generic_category(). Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102425 * src/c++11/system_error.cc (system_error_category::default_error_c

[committed] libstdc++: std::system_category should know meaning of zero [PR102425]

2021-09-23 Thread Jonathan Wakely via Gcc-patches
Although 0 is not an errno value, it should still be recognized as corresponding to a value belonging to the generic_category(). Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102425 * src/c++11/system_error.cc (system_error_category::default_error_c

[committed] libstdc++: Improvements to standard error category objects

2021-09-23 Thread Jonathan Wakely via Gcc-patches
This ensures that the objects returned by std::generic_category() and std::system_category() are initialized before any code starts executing, and are not destroyed at the end of the program. This means it is always safe to access them, even during startup and termination. See LWG 2992 and P1195R0

[committed] libstdc++: Make std::system_category() recognize Windows error codes

2021-09-23 Thread Jonathan Wakely via Gcc-patches
The std::system_category error category should be used for system-specific error codes, which means on Windows it should be used for Windows error codes. Currently that category assumes that the error numbers it deals with are errno numbers, which means that ERROR_ACCESS_DENIED (which has value 0x

[committed] libstdc++: Disable PCH for test that depends on a macro being defined

2021-09-23 Thread Jonathan Wakely via Gcc-patches
This test tries to ensure that can be included after defining _XOPEN_SOURCE=600, which doesn't test anything if that header is already included via the PCH before the macro definition. Disable PCH so that it behaves as intended. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: *

[committed] libstdc++: Remove c++20-specific dg-error directives in test

2021-09-23 Thread Jonathan Wakely via Gcc-patches
I added extra dg-error directives for C++20 to match the extra errors caused by some of the call stack being constexpr in C++20. Since Jason's changes to reduce those errors, those dg-error lines no longer match. This removes them again. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog:

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Sep 2021, 20:07 Jakub Jelinek via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On Thu, Sep 23, 2021 at 11:08:37AM -0700, Thomas Rodgers wrote: > > From: Thomas Rodgers > > > > This change implements P0528 which requires that padding bits not > > participate in atomic compare exchange o

[committed] libstdc++: Remove redundant 'inline' specifiers

2021-09-24 Thread Jonathan Wakely via Gcc-patches
These functions are constexpr, which means they are implicitly inline. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/range_access.h (cbegin, cend): Remove redundant 'inline' specifier. Tested x86_64-linux. Committed to trunk. commit 9b11107ed72ca543af41

Re: Fix 48631_neg test in _GLIBCXX_VERSION_NAMESPACE mode

2021-09-27 Thread Jonathan Wakely via Gcc-patches
On Mon, 27 Sept 2021 at 21:26, François Dumont via Libstdc++ wrote: > > Here is a small patch to fix a test which fails in > _GLIBCXX_VERSION_NAMESPACE mode. > > IMHO it would be better to avoid putting content in > versioned namespace, no ? > > There is of course more work to do, so for now here

[committed] libstdc++: Fix mismatched noexcept-specifiers in filesystem::path [PR102499]

2021-09-28 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102499 * include/bits/fs_path.h (path::begin, path::end): Add noexcept to declarations, to match definitions. Tested x86_64-linux. Committed to trunk. commit f2b7f56a15d9cbbd2f0db22e0e39c4dd161bab69 Aut

[committed] libstdc++: Improve std::forward static assert message

2021-09-28 Thread Jonathan Wakely via Gcc-patches
The previous message told you something was wrong, but not why it happened or why it's bad. This changes it to explain that the function is being misused. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/move.h (forward(remove_reference_t&&)): Improve text o

[committed] libstdc++: Specialize std::pointer_traits<__normal_iterator>

2021-09-28 Thread Jonathan Wakely via Gcc-patches
This allows std::__to_address to be used with __normal_iterator in C++11/14/17 modes. Without the partial specialization the deduced pointer_traits::element_type is incorrect, and so the return type of __to_address is wrong. A similar partial specialization is probably needed for __gnu_debug::_Saf

[committed] libstdc++: Fix _OutputIteratorConcept checks in algorithms

2021-09-28 Thread Jonathan Wakely via Gcc-patches
The _OutputIteratorConcept should be checked using the correct value category. The std::move_backward and std::copy_backward algorithms should use _OutputIteratorConcept instead of _ConvertibleConcept. In order to use the correct value category, the concept should use a function that returns _Valu

[committed] libstdc++: Fix tests that use invalid types in ordered containers

2021-09-28 Thread Jonathan Wakely via Gcc-patches
Types used in ordered containers need to be comparable, or the container needs to use a custom comparison function. These tests fail when _GLIBCXX_CONCEPT_CHECKS is defined, because the element types aren't comparable. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/2

[committed] libstdc++: Improve types used as iterators in testsuite

2021-09-28 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/25_algorithms/copy/34595.cc: Add missing operation for type used as an iterator. * testsuite/25_algorithms/unique_copy/check_type.cc: Likewise. Tested x86_64-linux. Committed to trunk. commit 5f1db7627f6

[committed] libstdc++: Fix concept checks for iterators

2021-09-28 Thread Jonathan Wakely via Gcc-patches
This adds some additional checks the the C++98-style concept checks for iterators, and removes some bogus checks for mutable iterators. Instead of requiring that the result of dereferencing a mutable iterator is assignable (which is a property of the value type, not required for the iterator) check

[committed] libstdc++: Skip tests that fail with _GLIBCXX_CONCEPT_CHECKS

2021-09-28 Thread Jonathan Wakely via Gcc-patches
The extension that allows implicitly rebinding a container's allocator is not allowed when _GLIBCXX_CONCEPT_CHECKS is defined, so skip the tests for that extension. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/23_containers/deque/requirements/explicit_instantiatio

[committed] libstdc++: Skip container adaptor tests that fail concept checks

2021-09-28 Thread Jonathan Wakely via Gcc-patches
As an extension, our container adaptors SFINAE away the default constructor if the adapted sequence container is not default constructible. When _GLIBCXX_CONCEPT_CHECKS is defined we enforce that the sequence is default constructible, so the tests for the extension fail. This disables the relevant

[committed] libstdc++: Define macro before it is first checked

2021-09-28 Thread Jonathan Wakely via Gcc-patches
On Thu, 2 Sept 2021 at 22:25, Jonathan Wakely wrote: > > On Thu, 2 Sept 2021 at 19:00, Jonathan Wakely wrote: > > > > * include/bits/atomic_wait.h (_GLIBCXX_HAVE_PLATFORM_WAIT): > > Define before first attempt to check it. > > > > Tested x86_64-linux and powerpc64-linux, not committ

[PATCH] libstdc++: Fix return values for atomic wait on futex

2021-09-28 Thread Jonathan Wakely via Gcc-patches
This fixes a logic error in the futex-based timed wait. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__platform_wait_until_impl): Return false for ETIMEDOUT and true otherwise. Tested x86_64-linux. I'm not seeing any tests fail as

[committed] libstdc++: Add noexcept to functions in

2021-09-28 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/regex.h (basic_regex, swap): Add noexcept to non-throwing functions. * include/bits/regex_automaton.h (_State_base, _State) (_NFA_base): Likewise. * include/bits/regex_compiler.h (_Compi

[committed] libstdc++: Tweaks to to avoid warnings

2021-09-28 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/regex_compiler.tcc: Add line break in empty while statement. * include/bits/regex_executor.tcc: Avoid unused parameter warning. Tested x86_64-linux. Committed to trunk. commit b5f276b8c76d892f

[committed] libstdc++: Remove obfuscating typedefs in

2021-09-28 Thread Jonathan Wakely via Gcc-patches
There is no benefit to using _SizeT instead of size_t, and IterT tells you less about the type than const _CharT*. This removes some unhelpful typedefs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/regex_automaton.h (_NFA_base::_SizeT): Remove. * include

Re: Fix 48631_neg test in _GLIBCXX_VERSION_NAMESPACE mode

2021-09-28 Thread Jonathan Wakely via Gcc-patches
On Tue, 28 Sept 2021 at 21:21, François Dumont via Libstdc++ wrote: > > On 27/09/21 11:06 pm, Jonathan Wakely wrote: > > On Mon, 27 Sept 2021 at 21:26, François Dumont via Libstdc++ > > wrote: > >> Here is a small patch to fix a test which fails in > >> _GLIBCXX_VERSION_NAMESPACE mode. > >> > >>

<    10   11   12   13   14   15   16   17   18   19   >