Re: [PATCH] libstdc++: Test for formatting with empty spec for calendar types.

2025-05-30 Thread Jonathan Wakely
On Fri, 30 May 2025 at 15:26, Tomasz Kaminski wrote: > > > > On Fri, May 30, 2025 at 1:55 PM Jonathan Wakely wrote: >> >> On Fri, 30 May 2025 at 10:38, Tomasz Kamiński wrote: >> > >> > Adding a test for behavior of the ostream operator and the for

Re: [PATCH] libstdc++: Test for formatting with empty spec for calendar types.

2025-05-30 Thread Jonathan Wakely
On Fri, 30 May 2025 at 10:38, Tomasz Kamiński wrote: > > Adding a test for behavior of the ostream operator and the formatting > with empty chron-spec for the chrono types. This commit covers calendar > types. > > libstdc++-v3/ChangeLog: > > * testsuite/std/time/format/empty_spec.cc: New t

Re: [PATCH v2 00/16] libstdc++: Atomic wait/notify ABI stabilization

2025-05-30 Thread Jonathan Wakely
On Thu, 29 May 2025 at 12:12, Jonathan Wakely wrote: > > This series complete Tom's work to refactor the C++20 atomic wait/notify > code, and includes several follow-up patches from me. The goal is to > move the core implementation pieces into libstdc++.so instead of > defini

[PATCH v2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-29 Thread Jonathan Wakely
The current overload set for __unique_copy handles three cases: - The input range uses forward iterators, the output range does not. This is the simplest case, and can just compare adjacent elements of the input range. - Neither the input range nor output range use forward iterators. This r

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 15:48, Jonathan Wakely wrote: > > On Thu, 29 May 2025 at 15:42, Tomasz Kaminski wrote: > > > > > > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: > >> > >> Tested on x86_64-pc-linux-gnu, does this look OK for t

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 15:42, Tomasz Kaminski wrote: > > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: >> >> Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? >> >> -- >8 -- >> >> Instead of effectively doing a zipped comparison of the keys and values, >> compare them sepa

Re: [PATCH v3] libstdc++: Implement stringstream from string_view [PR119741]

2025-05-29 Thread Jonathan Wakely
On 29/05/25 09:50 -0400, Nathan Myers wrote: Change in V3: * Comment that p2495 specifies a drive-by constraint omitted as redundant * Adjust whitespace to fit in 80 columns Change in V2: * apply all review comments * remove redundant drive-by "requires" on ctor from string allocator arg * check

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 14:55, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? OK for both, thanks. > > -- >8 -- > > Instead of effectively doing a zipped comparison of the keys and values, > compare them separately to leverage the underlying containers' opt

[committed] libstdc++: Fix lwg4084.cc test FAIL on AIX

2025-05-29 Thread Jonathan Wakely
On AIX printf formats a quiet NaN as "NaNQ" and it doesn't matter whether %f or %F is used. Similarly, it always prints "INF" for infinity, even when %f is used. Adjust a test that currently fails due to this AIX-specific (and non-conforming) behaviour. libstdc++-v3/ChangeLog: * testsuite

[committed] libstdc++: Fix another 17_intro/names.cc failure on AIX

2025-05-29 Thread Jonathan Wakely
FAIL: 17_intro/names.cc -std=gnu++98 (test for excess errors) Also fix typo in experimental/names.cc where I did #undef for the wrong name in r16-901-gd1ced2a5ea6b09. libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc [_AIX] (a): Undefine. * testsuite/experimental/names.cc [_

[committed] libstdc++: Re-enable some XPASS tests for AIX

2025-05-29 Thread Jonathan Wakely
The deque shrink_to_fit.cc test always passes on AIX, I think it should not have been disabled. The 96088.cc tests pass for C++20 and later (I don't know why) so make them require C++20, as they fail otherwise. libstdc++-v3/ChangeLog: * testsuite/23_containers/deque/capacity/shrink_to_fi

[PATCH v2 16/16] libstdc++: Define __wait_result_type for atomic waiting

2025-05-29 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h: Use __wait_result_type. * include/bits/atomic_wait.h (__wait_result_type): New struct. (__wait_args::_M_prep_for_wait_on): Rename to _M_setup_wait, use __wait_result_type. (__atomic_wait_address): A

[PATCH v2 12/16] libstdc++: Optimise std::latch::arrive_and_wait

2025-05-29 Thread Jonathan Wakely
We don't need to wait if we know the counter has reached zero. libstdc++-v3/ChangeLog: * include/std/latch (latch::arrive_and_wait): Optimise. --- libstdc++-v3/include/std/latch | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/st

[PATCH v2 15/16] libstdc++: Rewrite std::counting_semaphore base class [PR118494]

2025-05-29 Thread Jonathan Wakely
Remove __platform_semaphore. Replace __atomic_semaphore with __semaphore_base and change its counter to be ptrdiff_t when the count doesn't fit in __platform_wait_t (PR 118494). Make the std::counting_semaphore constructor constexpr to support constant initialization (PR 110854). Add precondition

[PATCH v2 10/16] libstdc++: Rename __waiter_pool_impl to __waitable_state

2025-05-29 Thread Jonathan Wakely
The name __waiter_pool_impl is misleading. An object of that type is a member of the pool, not the pool itself, and it's not an "impl" of any abstract base class or generic concept. Just call it __waitable_state since it maintains the state used for waiting/notifying a waitable atomic object. Simi

[PATCH v2 13/16] libstdc++: Fix std::barrier for constant initialization [PR118395]

2025-05-29 Thread Jonathan Wakely
The std::barrier constructor should be constexpr, which means we need to defer the dynamic allocation if the constructor is called during constant-initialization. We can defer it to the first call to barrier::arrive, using compare-and-swap on an atomic (instead of the unique_ptr currently used). A

[PATCH v2 11/16] libstdc++: Move atomic wait/notify entry points into the library

2025-05-29 Thread Jonathan Wakely
This moves the implementation details of atomic wait/notify functions into the library, so that only a small API surface is exposed to users. This also fixes some race conditions present in the design for proxied waits: - The stores to _M_ver in __notify_impl must be protected by the mutex, and

[PATCH v2 14/16] libstdc++: Create new base class of std::barrier for non-dependent code

2025-05-29 Thread Jonathan Wakely
This moves all non-dependent state and logic for std::barrier into a new non-template base class, to avoid template bloat. This would permit moving the _M_arrive function into the library instead of the header. libstdc++-v3/ChangeLog: * include/std/barrier (__tree_barrier_base): New clas

[PATCH v2 06/16] libstdc++: Fix time_point conversion in atomic timed waits

2025-05-29 Thread Jonathan Wakely
Even if a time_point already uses the right clock, we might still need to convert it to use the expected duration. Calling __to_wait_clock will perform that conversion, so use that even when the clock is correct. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__to_wait_clock)

[PATCH v2 07/16] libstdc++: Simplify futex wrapper functions for atomic wait/notify

2025-05-29 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__platform_wait): Change function template to a normal function. The parameter is always __platform_wait_t* which is just int* for this implementation of the function. (__platform_notify): Likewise. ---

[PATCH v2 05/16] libstdc++: Fix race condition in new atomic notify code

2025-05-29 Thread Jonathan Wakely
When using a proxy object for atomic waiting and notifying operations, we need to ensure that the _M_ver value is always incremented by a notifying operation, even if we return early without doing the futex wake syscall. Otherwise we get missed wake-ups because the notifying thread doesn't modify t

[PATCH v2 08/16] libstdc++: Remove reinterpret_cast uses in atomic wait/notify

2025-05-29 Thread Jonathan Wakely
We can pass around void* instead of casting incompatible pointers to __platform_wait_t*, and then only static_cast to __platform_wait_t* when we know that's valid. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__wait_until_impl): Change first parameter to const void*

[PATCH v2 01/16] libstdc++: Atomic wait/notify ABI stabilization

2025-05-29 Thread Jonathan Wakely
From: Thomas Rodgers This represents a major refactoring of the previous atomic::wait and atomic::notify implementation detail. The aim of this change is to simplify the implementation details and position the resulting implementation so that much of the current header-only detail can be moved in

[PATCH v2 03/16] libstdc++: Whitespace fixes in atomic wait/notify code

2025-05-29 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h: Whitespace fixes. * include/bits/atomic_wait.h: Likewise. --- libstdc++-v3/include/bits/atomic_timed_wait.h | 206 +- libstdc++-v3/include/bits/atomic_wait.h | 8 +- 2 files changed, 104 insertions

[PATCH v2 04/16] libstdc++: Various fixes for atomic wait/notify code

2025-05-29 Thread Jonathan Wakely
Pass __wait_args_base by const reference instead of const pointer. I don't see a reason it needs to be passed by pointer to the internals. We can also avoid constructing a __wait_args from __wait_args_base in some places, instaad just using the latter directly. The code using the __wait_flags bitm

[PATCH v2 09/16] libstdc++: Rename __atomic_compare to __atomic_eq

2025-05-29 Thread Jonathan Wakely
This is an equality comparison rather than a three-way comparison like memcmp and <=>, so name it more precisely. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until_v): Replace __atomic_compare with __atomic_eq. (__atomic_wait_a

[PATCH v2 02/16] libstdc++: Pass __wait_args to internal API by const pointer

2025-05-29 Thread Jonathan Wakely
From: Thomas Rodgers This change splits the __wait_args data members to a new struct __wait_args_base and then passes that type by const pointer to the low level implementation functions. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__spin_until_impl): Accept __wa

[PATCH v2 00/16] libstdc++: Atomic wait/notify ABI stabilization

2025-05-29 Thread Jonathan Wakely
d::barrier doesn't use futex directly See the bugzilla PR for discussion. All tests pass on x86_64-linux and sparc-solaris and power-aix. I'm not expecting further review of this series, but I'm posting it one more time before pushing because I want to see the Linaro CI resul

[committed] libstdc++: Disable -Wlong-long warnings in boost_concept_check.h

2025-05-29 Thread Jonathan Wakely
The _IntegerConcept, _SignedIntegerConcept and _UnsignedIntegerConcept class template are specialized for long long, which gives warnings with -Wsystem-headers in C++98 mode. libstdc++-v3/ChangeLog: * include/bits/boost_concept_check.h: Disable -Wlong-long warnings. * test

[committed] libstdc++: Document that -std cannot be used in --target_board now

2025-05-29 Thread Jonathan Wakely
Only using GLIBCXX_TESTSUITE_STDS or v3_std_list works now. libstdc++-v3/ChangeLog: * doc/xml/manual/test.xml: Remove outdated documentation on testing with -std options in --target_board. * doc/html/manual/test.html: Regenerate. --- Pushed to trunk. libstdc++-v3/doc/ht

Re: [PATCH v4 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 10:31, Jonathan Wakely wrote: > > On Mon, 26 May 2025 at 15:21, Luc Grosheintz wrote: > > > > [mdspan.layout.left.cons] of N4950 states that this ctor is not > > noexcept. Since, all other ctors of layout_left, layout_right or > > layout_strid

Re: [PATCH v4 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-05-29 Thread Jonathan Wakely
On Mon, 26 May 2025 at 15:21, Luc Grosheintz wrote: > > [mdspan.layout.left.cons] of N4950 states that this ctor is not > noexcept. Since, all other ctors of layout_left, layout_right or > layout_stride are noexcept, the choice was made, based on > [res.on.exception.handling], to make this ctor no

Re: [PATCH] libstdc++: Fix tuple/pair confusion with std::erase_if(flat_foo) [PR120465]

2025-05-28 Thread Jonathan Wakely
f > a tuple to the predicate. > * testsuite/23_containers/flat_map/1.cc (test07): Strengthen > to expect the argument passed to the predicate is a pair. > * testsuite/23_containers/flat_multimap/1.cc (test07): Likewise. > > Co-authored-by: Jonathan Wakely > -

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

2025-05-27 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc [_AIX] (n): Undefine. * testsuite/experimental/names.cc [_AIX] (ptr): Undefine. --- Tested x86_64-linux and powerpc-aix. Pushed to trunk. libstdc++-v3/testsuite/17_intro/names.cc | 2 ++ libstdc++-v3/testsuite/experimenta

Re: [committed] libstdc++: Fix test failures for 32-bit AIX

2025-05-27 Thread Jonathan Wakely
On Tue, 27 May 2025 at 13:46, Tomasz Kaminski wrote: > > > > On Tue, May 27, 2025 at 2:38 PM Jonathan Wakely wrote: >> >> With -maix32 (the default) we only have 16-bit wchar_t so these tests >> fail. The debug.cc one is because we use -fwide-exec-charset=UTF-32BE

[committed] libstdc++: Regenerate include/Makefile.in

2025-05-27 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/Makefile.in: Regenerate. --- Pushed to trunk. libstdc++-v3/include/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index a6e602327b6e..0ef8564f2385 10064

Re: [PATCH] libstdc++: Replace some uses of std::__addressof with std::addressof

2025-05-27 Thread Jonathan Wakely
On Tue, 27 May 2025 at 13:26, Tomasz Kaminski wrote: > > > > On Fri, May 23, 2025 at 7:00 PM Jonathan Wakely wrote: >> >> Since r16-154-gc91eb5a5c13f14 std::addressof is no less efficient than >> std::__addressof, so change some uses of the latter to the former.

[committed] libstdc++: Fix test failures for 32-bit AIX

2025-05-27 Thread Jonathan Wakely
With -maix32 (the default) we only have 16-bit wchar_t so these tests fail. The debug.cc one is because we use -fwide-exec-charset=UTF-32BE which tries to encode each wide character as four bytes in a 2-byte wchar_t. The format.cc one is because the clown face character can't be encoded in a single

Re: [PATCH v1 0/1] Add error message to cmp_* and in_range.

2025-05-27 Thread Jonathan Wakely
On Tue, 27 May 2025 at 07:51, Luc Grosheintz wrote: > > While reading the compiler output of > > make check-target-libstdc++-v3 > > for buggy code, e.g. cmp_equal(1.0, 1.0), the error message > was very short, and I saw no hint that neither of the two > template arguments weren't integers. Ess

[committed] doc: Fix typo in description of nonstring attribute

2025-05-27 Thread Jonathan Wakely
gcc/ChangeLog: * doc/extend.texi (Common Variable Attributes): Fix typo in description of nonstring. --- Pushed as obvious. gcc/doc/extend.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 442fce653a40..989df

Re: [PATCH v1] libstdc++: Fix bug in default ctor of extents.

2025-05-27 Thread Jonathan Wakely
On Mon, 26 May 2025 at 08:49, Tomasz Kaminski wrote: > > > > On Sat, May 24, 2025 at 1:29 PM Luc Grosheintz > wrote: >> >> The array that stores the dynamic extents used to be default >> initialized. The standard requires value intialization. This >> commit fixes the bug and adds a test. >> >> l

Re: [PATCH] libstdc++: Add smart ptr owner_equals and owner_hash structs and members for P1901R2

2025-05-23 Thread Jonathan Wakely
On Fri, 23 May 2025 at 18:56, Paul Keir wrote: > > This patch implements C++26 "Enabling the Use of weak_ptr as Keys in > Unordered Associative Containers", as specified in P1901R2. Splendid, thanks. I'll review this more carefully next week. Some quick comments: This should define the __cpp_l

[committed] libstdc++: Add always_inline to std::is_constant_evaluated()

2025-05-23 Thread Jonathan Wakely
We already have the attribute on std::__is_constant_evaluated() but for some reason not on std::is_constant_evaluated(). libstdc++-v3/ChangeLog: * include/std/type_traits (is_constant_evaluated): Add always_inline attribute. --- Tested x86_64-linux. Pushed to trunk. libstdc++-

[PATCH] libstdc++: Replace some uses of std::__addressof with std::addressof

2025-05-23 Thread Jonathan Wakely
Since r16-154-gc91eb5a5c13f14 std::addressof is no less efficient than std::__addressof, so change some uses of the latter to the former. We can't change them all, because some uses need to compile as C++98 which only has std::__addressof. libstdc++-v3/ChangeLog: * include/bits/stl_const

[PATCH] libstdc++: Support std::abs for 128-bit integers and floats [PR96710]

2025-05-23 Thread Jonathan Wakely
Currently we only provide std::abs(__int128) and std::abs(__float128) for non-strict modes, i.e. -std=gnu++NN but not -std=c++NN. This defines those overloads for strict modes too, as a small step towards resolving PR 96710 (which will eventually mean that __int128 satisfies the std::integral conc

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

2025-05-23 Thread Jonathan Wakely
There are some names in Solaris libc headers which cause: FAIL: 17_intro/names.cc -std=gnu++98 (test for excess errors) FAIL: 17_intro/names.cc -std=gnu++11 (test for excess errors) libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc [__sun__] (a, i, n): Undefine. --- Tested x86_64-

Re: [PATCH v2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-23 Thread Jonathan Wakely
On Fri, 23 May 2025 at 16:31, Tomasz Kaminski wrote: > > > > On Fri, May 23, 2025 at 1:52 PM Jonathan Wakely wrote: >> >> On 23/05/25 10:03 +0100, Jonathan Wakely wrote: >> >On 22/05/25 14:50 +0200, Tomasz Kamiński wrote: >> >>From: Jonathan Wakely

Re: [PATCH v6] libstdc++: Implement C++26 function_ref [PR119126]

2025-05-23 Thread Jonathan Wakely
On 21/05/25 11:07 +0200, Tomasz Kamiński wrote: This patch implements C++26 function_ref as specified in P0792R14, with correction for constraints for constructor accepting nontype_t parameter from LWG 4256. As function_ref may store a pointer to the const object, __Ptrs::_M_obj is changed to co

Re: [PATCH v2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-23 Thread Jonathan Wakely
On 23/05/25 10:03 +0100, Jonathan Wakely wrote: On 22/05/25 14:50 +0200, Tomasz Kamiński wrote: From: Jonathan Wakely This papers implements C++26 std::indirect as specified in P3019 with amendment to move assignment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog

[PATCH] Add anchor to new link to GCC 15 notes

2025-05-23 Thread Jonathan Wakely
--- Jakub poined out I'd forgotten the #cxx20-iterators on the new link. And I've just realised it's a fragment not an anchor, so the commit message is wrong, oops. Pushed to wwwdocs. htdocs/gcc-14/porting_to.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/g

[wwwdocs] Add notes about C++20 iterator concepts and std::vector

2025-05-23 Thread Jonathan Wakely
--- Pushed to wwwdocs. htdocs/gcc-14/porting_to.html | 10 ++ htdocs/gcc-15/porting_to.html | 61 +++ 2 files changed, 71 insertions(+) diff --git a/htdocs/gcc-14/porting_to.html b/htdocs/gcc-14/porting_to.html index 2d8eaf3a..e8c2869b 100644 --- a/htdocs/gcc

Re: [PATCH v2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-23 Thread Jonathan Wakely
On 22/05/25 14:50 +0200, Tomasz Kamiński wrote: From: Jonathan Wakely This papers implements C++26 std::indirect as specified in P3019 with amendment to move assignment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header

Re: [PATCH v4] libstdc++: Implement C++26 features (P2546R5)

2025-05-22 Thread Jonathan Wakely
On Mon, 5 May 2025 at 10:16, Uros Bizjak wrote: > > On Thu, May 1, 2025 at 12:59 PM Jonathan Wakely wrote: > > > > This includes the P2810R4 (is_debugger_present is_replaceable) changes, > > allowing std::is_debugger_present to be replaced by the program. > > >

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:48, Jonathan Wakely wrote: > > On Thu, 22 May 2025 at 16:44, Jonathan Wakely wrote: > > > > On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > > > > > > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kami

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:44, Jonathan Wakely wrote: > > On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski wrote: > >> > >> > >> > >> On Thu, May 22, 2025 at 5:0

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski wrote: >> >> >> >> On Thu, May 22, 2025 at 5:04 PM Jonathan Wakely wrote: >>> >>> On Thu, 22 May 2025 at 15:50, Tomasz Kaminski wr

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 15:50, Tomasz Kaminski wrote: > > > > On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely wrote: >> >> The current overload set for __unique_copy handles three cases: >> >> - The input range uses forward iterators, the output range does not.

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 13:23, Daniel Krügler wrote: > > Am Do., 22. Mai 2025 um 11:48 Uhr schrieb Tomasz Kamiński > : >> >> From: Jonathan Wakely >> >> This papers implements C++27 std::indirect as specified >> in P3019 with ammendment to move assgiment

[PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
The current overload set for __unique_copy handles three cases: - The input range uses forward iterators, the output range does not. This is the simplest case, and can just compare adjacent elements of the input range. - Neither the input range nor output range use forward iterators. This r

[PATCH 1/2] libstdc++: Fix concept checks for std::unique_copy [PR120384]

2025-05-22 Thread Jonathan Wakely
This looks to have been wrong since r0-125454-gea89b2482f97aa which introduced the predefined_ops.h. Since that change, the binary predicate passed to std::__unique_copy is _Iter_comp_iter, which takes arguments of the iterator type, not the iterator's value type. This removes the checks from the

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Jonathan Wakely
On 22/05/25 11:19 +0200, Tomasz Kamiński wrote: From: Jonathan Wakely This papers implements C++27 std::indirect as specified in P3019 with ammendment to move assgiment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header

[committed] libstdc++: Fix PSTL test iterators

2025-05-22 Thread Jonathan Wakely
These were fixed upstream by: https://github.com/uxlfoundation/oneDPL/pull/534 https://github.com/uxlfoundation/oneDPL/pull/546 libstdc++-v3/ChangeLog: * testsuite/util/pstl/test_utils.h (ForwardIterator::operator++): Fix return type. (BidirectionalIterator::operator++): L

Re: [PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 10:38, Tomasz Kamiński wrote: > > From: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/bits/allocated_ptr.h (_Scoped_allocation): New class > template. > > Co-Authored-By: Tomasz Kamiński > Signed-off-by: Toma

Re: [PATCH] libstdc++: Make debug iterator pointer sequence const [PR116369]

2025-05-22 Thread Jonathan Wakely
On Thu, 15 May 2025, 06:26 François Dumont, wrote: > Got > > On 14/05/2025 18:46, Jonathan Wakely wrote: > > On Wed, 14 May 2025 at 17:31, François Dumont > wrote: > >> On 12/05/2025 23:03, Jonathan Wakely wrote: > >>> On 31/03/25 22:20

Re: [PATCH] libstdc++: Make debug iterator pointer sequence const [PR116369]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025, 08:26 Jonathan Wakely, wrote: > > > On Thu, 15 May 2025, 06:26 François Dumont, wrote: > >> Got >> >> On 14/05/2025 18:46, Jonathan Wakely wrote: >> > On Wed, 14 May 2025 at 17:31, François Dumont >> wrote: >> >> On

Re: [PATCH] libstdc++: Fix vector(from_range_t, R&&) for exceptions [PR120367]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025, 07:21 Tomasz Kaminski, wrote: > > > On Wed, May 21, 2025 at 5:41 PM Jonathan Wakely > wrote: > >> Because this constructor delegates to vector(a) the object has been >> fully constructed and the destructor will run if an exception happens. &

[PATCH] libstdc++: Fix vector(from_range_t, R&&) for exceptions [PR120367]

2025-05-21 Thread Jonathan Wakely
Because this constructor delegates to vector(a) the object has been fully constructed and the destructor will run if an exception happens. That means we need to set _M_finish == _M_start so that the destructor doesn't try to destroy any elements. libstdc++-v3/ChangeLog: PR libstdc++/12036

Re: [PATCH 3/5] libstdc++: keep subtree sizes in pb_ds binary search trees (PR 81806)

2025-05-21 Thread Jonathan Wakely
On Wed, 21 May 2025 at 06:57, Xi Ruoyao wrote: > > On Tue, 2025-05-20 at 13:06 +0100, Jonathan Wakely wrote: > > On 13/07/20 16:45 +0800, Xi Ruoyao via Libstdc++ wrote: > > > > > > > The second and third patch together resolve PR 81806. > > > > > &

Re: [PATCH v4] libstdc++: Implement C++26 function_ref [PR119126]

2025-05-20 Thread Jonathan Wakely
On 16/05/25 15:56 +0200, Tomasz Kamiński wrote: This patch implements C++26 function_ref as specified in P0792R14, with correction for constraints for constructor accepting nontype_t parameter from LWG 4256. As function_ref may store a pointer to the const object, __Ptrs::_M_obj is changed to co

[committed] libstdc++: Fix incorrect links to archived SGI STL docs

2025-05-20 Thread Jonathan Wakely
In r8--g25949ee33201f2 I updated some URLs to point to copies of the SGI STL docs in the Wayback Machine, because the original pags were no longer hosted on sgi.com. However, I incorrectly assumed that if one archived page was at https://web.archive.org/web/20171225062613/... then all the other

Re: [PATCH 4/5] libstdc++: keep subtree sizes in pb_ds binary search trees (PR 81806)

2025-05-20 Thread Jonathan Wakely
On 13/07/20 16:48 +0800, Xi Ruoyao via Libstdc++ wrote: The fourth patch converts the point_iterator of rb_tree and splay_tree based maps to random access iterator. With the subtree size kept we can implement the operators required by random access iterator in logarithm time. Random access i

Re: [PATCH 2/5] libstdc++: keep subtree sizes in pb_ds binary search trees (PR 81806)

2025-05-20 Thread Jonathan Wakely
On 13/07/20 16:42 +0800, Xi Ruoyao via Libstdc++ wrote: The second and third patch together resolve PR 81806. The attached patch keeps the subtree size in binary search tree nodes. libstdc++-v3/ChangeLog: * include/ext/pb_ds/detail/rb_tree_map_/node.hpp (rb_tree_node_::siz

Re: [PATCH 3/5] libstdc++: keep subtree sizes in pb_ds binary search trees (PR 81806)

2025-05-20 Thread Jonathan Wakely
On 13/07/20 16:45 +0800, Xi Ruoyao via Libstdc++ wrote: The second and third patch together resolve PR 81806. The attached patch modifies split_finish to use the subtree size we maintained in the previous patch, resolving libstdc++/81806. libstdc++-v3/ChangeLog: PR libstdc++/81806

Re: [PATCH 1/5] libstdc++: keep subtree sizes in pb_ds binary search trees (PR 81806)

2025-05-20 Thread Jonathan Wakely
On 13/07/20 16:40 +0800, Xi Ruoyao via Libstdc++ wrote: The first patch removes two redundant statements which are confusing. It should be applied anyway, disregarding other patches. The patch is attached, to prevent my mail client from destroying it :(. Please ignore a previous duplication o

Re: [PATCH] libstdc++: Implement stringstream from string_view [P2495R3]

2025-05-20 Thread Jonathan Wakely
On Tue, 20 May 2025 at 09:10, Tomasz Kaminski wrote: > > > > On Mon, May 19, 2025 at 11:28 PM Nathan Myers wrote: > In the title, we usually put link to bugzilla PR119741 in your case, not the > paper. > Then link the paper in commit descritpion. > >> Add constructors to stringbuf, stringstream,

Re: [PATCH v4] libstdc++: Cleanup and stabilize format _Spec<_CharT> and _Pres_type.

2025-05-20 Thread Jonathan Wakely
On 20/05/25 09:35 +0200, Tomasz Kamiński wrote: These patch makes following changes to _Pres_type values: * _Pres_esc is replaced with separate _M_debug flag. * _Pres_s, _Pres_p do not overlap with _Pres_none. * hexadecimal presentation use same values for pointer, integer and floating point ty

Re: [PATCH] libstdc++: Implement stringstream from string_view [P2495R3]

2025-05-20 Thread Jonathan Wakely
On Tue, 20 May 2025 at 10:08, Jonathan Wakely wrote: > > On Tue, 20 May 2025 at 09:10, Tomasz Kaminski wrote: > > > > > > > > On Mon, May 19, 2025 at 11:28 PM Nathan Myers wrote: > > In the title, we usually put link to bugzilla PR119741 in your case, not &g

Re: [PATCH] libstdc++: Implement stringstream from string_view [P2495R3]

2025-05-20 Thread Jonathan Wakely
On Tue, 20 May 2025 at 09:10, Tomasz Kaminski wrote: > > > > On Mon, May 19, 2025 at 11:28 PM Nathan Myers wrote: > In the title, we usually put link to bugzilla PR119741 in your case, not the > paper. > Then link the paper in commit descritpion. Right. When there's no bugzilla I'll sometimes p

Re: [PATCH] libstdc++: Implement stringstream from string_view [P2495R3]

2025-05-20 Thread Jonathan Wakely
On Tue, 20 May 2025 at 09:10, Tomasz Kaminski wrote: > > > > On Mon, May 19, 2025 at 11:28 PM Nathan Myers wrote: >> +void >> +test02() >> +{ >> + // Test C++26 constructors taking string views using different allocators >> + >> + using alloc_type = __gnu_test::tracker_allocator; > > I would us

Re: [PATCH] [testsuite] tolerate missing std::stold

2025-05-20 Thread Jonathan Wakely
On Tue, 20 May 2025, 05:00 Alexandre Oliva, wrote: > > basic_string.h doesn't define the non-w string version of std::stold > when certain conditions aren't met, and then a couple of tests fail to > compile. > > Guard the portions of the tests that depend on std::stold with the > conditions for i

Re: [PATCH] libstdc++: Implement C++23 P1659R3 starts_with and ends_with

2025-05-19 Thread Jonathan Wakely
On Mon, 19 May 2025 at 10:35, Tomasz Kaminski wrote: > > > > On Mon, May 19, 2025 at 11:29 AM Jonathan Wakely wrote: >> >> On Mon, 19 May 2025 at 05:46, Patrick Palka wrote: >> > >> > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? >>

Re: [PATCH] libstdc++: Implement C++23 P1659R3 starts_with and ends_with

2025-05-19 Thread Jonathan Wakely
On Mon, 19 May 2025 at 05:46, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > -- >8 -- > > libstdc++-v3/ChangeLog: > > * include/bits/ranges_algo.h (__starts_with_fn, starts_with): > Define. > (__ends_with_fn, ends_with): Define. >

[PATCH] libstdc++: Fix some Clang -Wsystem-headers warnings in

2025-05-16 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/std/ranges (_ZipTransform::operator()): Remove name of unused parameter. (chunk_view::_Iterator, stride_view::_Iterator): Likewise. (join_with_view): Declare _Iterator and _Sentinel as class instead of struct. (repea

[PATCH] libstdc++: Fix std::format of chrono::local_days with {} [PR120293]

2025-05-16 Thread Jonathan Wakely
Formatting of chrono::local_days with an empty chrono-specs should be equivalent to inserting it into an ostream, which should use the overload for inserting chrono::sys_days into an ostream. The implementation of empty chrono-specs in _M_format_to_ostream takes some short cuts, and that wasn't bei

[PATCH] libstdc++: Fix proc check_v3_target_namedlocale for "" locale [PR65909]

2025-05-15 Thread Jonathan Wakely
When the last format argument to a Tcl proc is named 'args' it has special meaning and is a list that accepts any number of arguments[1]. This means when "" is passed to the proc and then we expand "$args" we get an empty list formatted as "{}". My r16-537-g3e2b83faeb6b14 change broke all uses of d

Re: [PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 16:12, Jonathan Wakely wrote: > > On Thu, 15 May 2025 at 16:11, Luc Grosheintz wrote: > > > > Without would make sense to me, because whenever I wrote an > > identifier with _ I felt like I was presenting the user with > > a name that they s

Re: [PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-15 Thread Jonathan Wakely
rgument sounds reasonable. > > > > On Thu, May 15, 2025 at 12:25 PM Ville Voutilainen < > > ville.voutilai...@gmail.com> wrote: > > > >> Mild preference against; use the names from the standard, not the > >> implementation, in such diagnostics. > &

Re: [PATCH v2] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 15:02, Rainer Orth wrote: > > Hi Jonathan, > > >> > this patch broke Solaris bootstrap, both i386-pc-solaris2.11 and > >> > sparc-sun-solaris2.11: > >> > > >> > In file included from > >> > /vol/gcc/src/hg/master/local/libstdc++-v3/src/c++20/format.cc:29: > >> > /var/gcc/reg

Re: [PATCH v2] libstdc++: Fix std::format_kind primary template for Clang [PR120190]

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 13:56, Tomasz Kaminski wrote: > > > > On Thu, May 15, 2025 at 2:53 PM Jonathan Wakely wrote: >> >> On Thu, 15 May 2025 at 13:43, Tomasz Kaminski wrote: >> > >> > >> > >> > On Thu, May 15, 2025 at 2:41 PM Jonatha

Re: [PATCH v2] libstdc++: Fix std::format_kind primary template for Clang [PR120190]

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 13:43, Tomasz Kaminski wrote: > > > > On Thu, May 15, 2025 at 2:41 PM Jonathan Wakely wrote: >> >> On 15/05/25 14:35 +0200, Tomasz Kaminski wrote: >> >Please also add the message to dg-error check in format_kind_neg.cc. >> >With

[PATCH v2] libstdc++: Fix std::format_kind primary template for Clang [PR120190]

2025-05-15 Thread Jonathan Wakely
On 15/05/25 14:35 +0200, Tomasz Kaminski wrote: Please also add the message to dg-error check in format_kind_neg.cc. With that LGTM. Yes, already done locally. Here's what I'm testing now. commit 3c154b2d95d30580c18aa0fedd9e67200867653f Author: Jonathan Wakely AuthorDate: Thu

Re: [PATCH] libstdc++: Fix std::format_kind primary template for Clang [PR120190]

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 12:15, Daniel Krügler wrote: > > Am Do., 15. Mai 2025 um 13:00 Uhr schrieb Jonathan Wakely > : >> >> Although Clang trunk has been adjusted to handle our std::format_kind >> definition (because they need to be able to compile the GCC 15.1.0

[PATCH] libstdc++: Fix std::format_kind primary template for Clang [PR120190]

2025-05-15 Thread Jonathan Wakely
Although Clang trunk has been adjusted to handle our std::format_kind definition (because they need to be able to compile the GCC 15.1.0 release), it's probably better to not rely on something that they might start diagnosing again in future. Define the primary template in terms of an immediately

Re: [PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-15 Thread Jonathan Wakely
On Thu, 15 May 2025 at 11:14, Jonathan Wakely wrote: > > On Wed, 14 May 2025 at 20:18, Luc Grosheintz wrote: > > > > The standard states that the IndexType must be a signed or unsigned > > integer. This mandate was implemented using `std::is_integral_v`. Which > &g

Re: [PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-15 Thread Jonathan Wakely
On Wed, 14 May 2025 at 20:18, Luc Grosheintz wrote: > > The standard states that the IndexType must be a signed or unsigned > integer. This mandate was implemented using `std::is_integral_v`. Which > also includes (among others) char and bool, which neither signed nor > unsigned integers. > > libs

[PATCH] libstdc++: Micro-optimization in std::arg overload for scalars

2025-05-14 Thread Jonathan Wakely
Use __builtin_signbit directly instead of std::signbit. libstdc++-v3/ChangeLog: * include/std/complex (arg(T)): Use __builtin_signbit instead of std::signbit. --- This would avoid overload resolution for std::signbit, and avoid a function call for -O0, but I'm not sure it's worth

Re: [PATCH RFC] libstdc++: run testsuite with -Wabi

2025-05-14 Thread Jonathan Wakely
On Mon, 12 May 2025 at 21:30, Jonathan Wakely wrote: > > On Mon, 12 May 2025 at 16:13, Jason Merrill wrote: > > > > On 5/9/25 1:31 PM, Jonathan Wakely wrote: > > > On Fri, 9 May 2025 at 18:13, Jonathan Wakely wrote: > > >> > > >>

[PATCH] libstdc++: Deprecate non-standard std::fabs(const complex&) [PR120235]

2025-05-14 Thread Jonathan Wakely
There was an overload of fabs for std::complex in TR1 and in some C++0x drafts, but it was removed from the working draft by LWG 595. Since we've been providing it for decades we should deprecate it before removing it. libstdc++-v3/ChangeLog: PR libstdc++/120235 * doc/html/*: Reg

[wwwdocs] Remove claims that the release timeline shows future releases

2025-05-14 Thread Jonathan Wakely
The timeline hasn't shown any tentative dates for future releases since 2006-03-06 when GCC 3.4.6 was released and the tentative date got replaced with the real date. Since then only actual release dates have been added, on the day when the release happens. --- OK for wwwdocs? htdocs/develop.htm

Re: [PATCH v2] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-05-14 Thread Jonathan Wakely
On Wed, 14 May 2025 at 20:50, Iain Sandoe wrote: > > > > > On 14 May 2025, at 18:42, Rainer Orth wrote: > > > > Hi Jonathan, > > > >> On 14/05/25 10:01 +0200, Tomasz Kamiński wrote: > >>> This commits adjust the way how the arguments are stored in the _Arg_value > >>> (and thus basic_format_args)

  1   2   3   4   5   6   7   8   9   10   >