Re: [PATCHv7] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-30 Thread Tomasz Kaminski
On Wed, Jul 30, 2025 at 12:48 AM Nathan Myers wrote: > Changes in v7: > * Clean up comments, inactive cases in tests. > * Restore symmetry of tests for bind_back and bind_front > * Add another test for type qualifier propagation, per review > * Add test verifying arguments are properly moved

Re: [PATCHv7] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-30 Thread Tomasz Kaminski
On Wed, Jul 30, 2025 at 12:48 AM Nathan Myers wrote: > Changes in v7: > * Clean up comments, inactive cases in tests. > * Restore symmetry of tests for bind_back and bind_front > * Add another test for type qualifier propagation, per review > * Add test verifying arguments are properly moved

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-30 Thread Tomasz Kaminski
On Wed, Jul 30, 2025 at 10:56 AM Luc Grosheintz wrote: > > > On 7/28/25 13:04, Tomasz Kaminski wrote: > > On Mon, Jul 28, 2025 at 10:24 AM Tomasz Kaminski > > wrote: > > > >> > >> > >> > >> On Mon, Jul 28, 2025 at 1

Re: [PATCH] libstdc++: Teach std::distance and std::advance about C++20 iterators [PR102181]

2025-07-28 Thread Tomasz Kaminski
Pushed to v16. On Fri, Jul 25, 2025 at 4:08 PM Patrick Palka wrote: > On Fri, 18 Jul 2025, Jonathan Wakely wrote: > > > When the C++98 std::distance and std::advance functions (and C++11 > > std::next and std::prev) are used with C++20 iterators there can be > > unexpected results, ranging from

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-28 Thread Tomasz Kaminski
On Mon, Jul 28, 2025 at 10:24 AM Tomasz Kaminski wrote: > > > > On Mon, Jul 28, 2025 at 10:03 AM Luc Grosheintz > wrote: > >> >> >> On 7/28/25 08:02, Tomasz Kaminski wrote: >> > On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz < >> luc.gr

Re: [PATCHv5] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-28 Thread Tomasz Kaminski
On Mon, Jul 28, 2025 at 11:27 AM Nathan Myers wrote: > Stabilizing. > > Changes in v5: > * Switch back to decltype(auto) returns > * Adjust tests to verify that calls treat and all bound args > as const. > * Use "&&", "||" and "!" in preference to "and", "or" and "not" > in deference to u

Re: Sequence of improvements to .

2025-07-28 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:42 PM Luc Grosheintz wrote: > This is a sequence of related improvements to we > discussed during review and then postponed. The ideas are: > > * Pre-compute the product of static extents; and a follow up > for fine-tuning for low-rank extents. > > * Returning t

Re: [PATCH v1 1/6] libstdc++: Fix style issues in .

2025-07-28 Thread Tomasz Kaminski
LGTM. Thanks. I pushed this commit. On Sun, Jul 27, 2025 at 2:48 PM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan: Small stylistic adjustments. > > Signed-off-by: Luc Grosheintz > --- > libstdc++-v3/include/std/mdspan | 17 - > 1 file changed,

Re: [PATCH v1 2/6] libstdc++: Precompute products of static extents.

2025-07-28 Thread Tomasz Kaminski
is is order is my > favourite). > This makes perfect sense, I was reviewing them, in order, so didn't notice later changes. As a submitter, you have all rights to choose your preferred order of commits, as it does not matter when they land in a single release. > > On 7/28/25 07:58, Tomasz

Re: [PATCH v1 6/6] libstdc++: Replace numeric_limit with __int_traits in mdspan.

2025-07-28 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:55 PM Luc Grosheintz wrote: > Using __int_traits avoids the need to include from . > This in turn should reduce the size of the pre-compiled . > Similar refactoring was carried out for PR92546. Unfortunately, > > ./gcc/xgcc -std=c++23 -P -E -x c++ - -include mdspan |

Re: [PATCH v1 5/6] libstdc++: Reduce template instantiations in .

2025-07-28 Thread Tomasz Kaminski
On Mon, Jul 28, 2025 at 10:50 AM Luc Grosheintz wrote: > > > On 7/28/25 08:13, Tomasz Kaminski wrote: > > On Sun, Jul 27, 2025 at 2:57 PM Luc Grosheintz > > > wrote: > > > >> In mdspan related code involving static extents, often the IndexType is >

Re: [PATCH v1 4/6] libstdc++: Improve extents::operator==.

2025-07-28 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:56 PM Luc Grosheintz wrote: > An interesting case to consider is: > > bool same11(const std::extents& e1, > const std::extents& e2) > { return e1 == e2; } > > Which has the following properties: > > - There's no mismatching static extents, preventing

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-28 Thread Tomasz Kaminski
On Mon, Jul 28, 2025 at 10:03 AM Luc Grosheintz wrote: > > > On 7/28/25 08:02, Tomasz Kaminski wrote: > > On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz > > > wrote: > > > >> The methods layout_{left,right}::mapping::stride are defined > >> as &g

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-28 Thread Tomasz Kaminski
On Mon, Jul 28, 2025 at 10:13 AM Luc Grosheintz wrote: > > > On 7/28/25 08:32, Tomasz Kaminski wrote: > > In the __fwd_prod, __rev_prod I would also add the case for all-dynamic > > extents, so we do not instantiate an array with all 1, i.e. we would > have: >

Re: [PATCH v1] libstdc++: Refactor tests for mdspan related accessors.

2025-07-28 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 3:38 PM Luc Grosheintz wrote: > Versions 1, 2 and 3 of the patch for adding aligned_accessor had a > bug in the constraints that allowed conversion of > > aligned_accessor a = aligned_accessor{}; > > and prevented the reverse. > > The file mdspan/accessors/generic.cc alr

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-27 Thread Tomasz Kaminski
evProd<_Extents>::_S_value[__r]; return __extents_prod(__exts, __sta_prod, __r + 1, __rank); } On Mon, Jul 28, 2025 at 8:02 AM Tomasz Kaminski wrote: > > > On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz > wrote: > >> The methods layout_{left,right}::mapping::stride

Re: [PATCH v1 5/6] libstdc++: Reduce template instantiations in .

2025-07-27 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:57 PM Luc Grosheintz wrote: > In mdspan related code involving static extents, often the IndexType is > part of the template parameters, even though it's not needed. > > This commit extracts the parts of _ExtentsStorage not related to > IndexType into a separate class _S

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-27 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz wrote: > The methods layout_{left,right}::mapping::stride are defined > as > > \prod_{i = 0}^r E[i] > \prod_{i = r+1}^n E[i] > > This is computed as the product of a pre-comupted static product and the > product of the required dynamic extents. >

Re: [PATCH v1 2/6] libstdc++: Precompute products of static extents.

2025-07-27 Thread Tomasz Kaminski
On Sun, Jul 27, 2025 at 2:53 PM Luc Grosheintz wrote: > Let E denote an multi-dimensional extent; n the rank of E; r = 0, ..., > n; E[i] the i-th extent; and D[k] be the (possibly empty) array of > dynamic extents. > > The two partial products for r = 0, ..., n: > > \prod_{i = 0}^r E[i] (fw

Re: [PATCH] libstdc++: Support braces as arguments for std::erase on inplace_vector [PR121196]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 25, 2025 at 4:57 PM Tomasz Kaminski wrote: > > > On Fri, Jul 25, 2025 at 4:49 PM Patrick Palka wrote: > >> On Fri, 25 Jul 2025, Tomasz Kamiński wrote: >> >> > PR libstdc++/121196 >> > >> > libstdc++-v3/ChangeLog: >&

Re: [PATCH] libstdc++: Support braces as arguments for std::erase on inplace_vector [PR121196]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 25, 2025 at 4:49 PM Patrick Palka wrote: > On Fri, 25 Jul 2025, Tomasz Kamiński wrote: > > > PR libstdc++/121196 > > > > libstdc++-v3/ChangeLog: > > > > * include/std/inplace_vector (std::erase): Provide default argument > > for _Up parameter. > > * testsuite/2

Re: [PATCH 2/2] libstdc++: Protect std::shared_ptr against counter overflow [PR71945]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 8:03 PM Jonathan Wakely wrote: > This adds a check when incrementing the shared count and weak count and > will trap if it overflows. This also double the effective range of the > counts for most 64-bit targets. > > The counter type, _Atomic_word, is usually a signed 32-bi

Re: [PATCH 2/2] libstdc++: Protect std::shared_ptr against counter overflow [PR71945]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 9:50 PM Jonathan Wakely wrote: > On Fri, 18 Jul 2025 at 19:18, Tomasz Kaminski wrote: > > > > > > > > On Fri, Jul 18, 2025 at 8:03 PM Jonathan Wakely > wrote: > >> > >> This adds a check when incrementing the shar

Re: [PATCH 1/2] libstdc++: Make atomicity helpers use unsigned arithmetic [PR121148]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 8:03 PM Jonathan Wakely wrote: > The standard requires that std::atomic::fetch_add does > not have undefined behaviour for signed overflow, instead it wraps like > unsigned integers. The compiler ensures this is true for the atomic > built-ins that std::atomic uses, but it

Re: [PATCH] libstdc++: doc: Rectify referencing of non-existent type

2025-07-25 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 10:04 AM wrote: > From: Tuur Martens > > The unordered_map header incorrectly refers to a non-existent template > parameter _Value in default template argument descriptions. They should > refer to _Key instead.\n\nThis patch fixes these descriptions to match the > actual

Re: [PATCH] Make it fast again

2025-07-25 Thread Tomasz Kaminski
Please ignore, send to the list by accident. On Fri, Jul 25, 2025 at 11:59 AM Tomasz Kamiński wrote: > Instead of using "::__overflow" using "__fwritable" and handle > flushing empty writebuf in constructor. > --- > This removes unconditional flushing in _File constructor, and > replace it with

Re: [PATCH v3 3/3] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-07-25 Thread Tomasz Kaminski
On Fri, Jul 25, 2025 at 10:37 AM Luc Grosheintz wrote: > > > On 7/23/25 11:25, Luc Grosheintz wrote: > > This commit completes the implementation of P2897R7 by implementing and > > testing the template class aligned_accessor. > > > > PR libstdc++/120994 > > > > libstdc++-v3/ChangeLog: > > >

Re: [PATCH] libstdc++: Cleaned up string_vector_iterators.cc test [PR104874]

2025-07-24 Thread Tomasz Kaminski
On Thu, Jul 24, 2025 at 10:50 AM Tomasz Kamiński wrote: > Removed the wrong_stuff() function, which was effectively empty for > actual test runs. Replaced the manual failure counter with the VERIFY > macro to simplify identifying failures. > > PR libstdc++/104874 > > libstdc++-v3/ChangeLo

Re: [PATCH] libstdc++: Teach std::distance and std::advance about C++20 iterators [PR102181]

2025-07-24 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 7:52 PM Jonathan Wakely wrote: > When the C++98 std::distance and std::advance functions (and C++11 > std::next and std::prev) are used with C++20 iterators there can be > unexpected results, ranging from compilation failure to decreased > performance to undefined behaviou

Re: [PATCH v3 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-23 Thread Tomasz Kaminski
Pushed to the trunk. On Wed, Jul 23, 2025 at 1:22 PM Tomasz Kaminski wrote: > I plan to merge this to trunk with one change to message, as mentioned > below, > to reduce the number of commits that will be piling up to get approved. > > On Wed, Jul 23, 2025 at 11:30 AM Luc Gros

Re: [PATCH v3 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-23 Thread Tomasz Kaminski
I plan to merge this to trunk with one change to message, as mentioned below, to reduce the number of commits that will be piling up to get approved. On Wed, Jul 23, 2025 at 11:30 AM Luc Grosheintz wrote: > All test code of default_accessor can be reused. This commit moves > the reuseable code i

Re: [PATCH v3 3/3] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-07-23 Thread Tomasz Kaminski
On Wed, Jul 23, 2025 at 11:34 AM Luc Grosheintz wrote: > This commit completes the implementation of P2897R7 by implementing and > testing the template class aligned_accessor. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (aligned_accessor): Ad

Re: [PATCH v1] libstdc++: Remove redundant parens in mdspan testsuite.

2025-07-23 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 3:38 PM Luc Grosheintz wrote: > A recent commit improved the macro VERIFY to eliminate the need for > certain parens. This commit updates the test code in > > 23_containers/mdspan > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/extents/ctor_ints.

Re: [PATCHv4] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-23 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 11:28 AM Tomasz Kaminski wrote: > > > On Tue, Jul 22, 2025 at 9:22 AM Nathan Myers wrote: > >> This should be close to ready. However, std::is_invocable >> and noexcept still fail oddly applied to the not_fp result. >> The remaining f

Re: [PATCHv4] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 11:28 AM Tomasz Kaminski wrote: > > > On Tue, Jul 22, 2025 at 9:22 AM Nathan Myers wrote: > >> This should be close to ready. However, std::is_invocable >> and noexcept still fail oddly applied to the not_fp result. >> The remaining f

Re: [PATCH v2 0/3] Implement aligned_accessor [P2897R7]

2025-07-22 Thread Tomasz Kaminski
Hi, These commits mostly LGTM, as mentioned, but as I have mentioned in other emails, They may stay as is for some time. However, we could land a (test rewrite) patch soon, as it does not introduce any functional changes, so you could send a v2 of that, and then patch series with only functional p

Re: [PATCH v2 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 11:58 AM Tomasz Kaminski wrote: > > > On Mon, Jul 21, 2025 at 10:19 AM Luc Grosheintz > wrote: > >> All test code of default_accessor can be reused. This commit moves >> the reuseable code into a file generic.cc and prepares the tests for >

Re: [PATCH v2 3/3] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:25 AM Luc Grosheintz wrote: > This commit completes the implementation of P2897R7 by implementing and > testing the template class aligned_accessor. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (aligned_accessor): Ad

Re: [PATCH v2 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:19 AM Luc Grosheintz wrote: > All test code of default_accessor can be reused. This commit moves > the reuseable code into a file generic.cc and prepares the tests for > reuse with aligned_accessor. > > The AllocatorTrait creates a unified interface for creating both >

Re: [PATCHv4] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 9:22 AM Nathan Myers wrote: > This should be close to ready. However, std::is_invocable > and noexcept still fail oddly applied to the not_fp result. > The remaining failing test cases in */nttp.cc, commented > out, need careful examination to see whether they should > be

Re: [PATCH v2 1/3] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:18 AM Luc Grosheintz wrote: > This commit implements and tests the function is_sufficiently_aligned > from P2897R7. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/align.h (is_sufficiently_aligned): New function. > * includ

Re: [PATCH v3] libstdc++: Implement std::dims from .

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 5:51 PM Luc Grosheintz wrote: > This commit implements the C++26 feature std::dims described in P2389R2. > It sets the feature testing macro to 202406 and adds tests. > > Also fixes the test mdspan/version.cc > > libstdc++-v3/ChangeLog: > > * include/bits/version.d

Re: [PATCH v1 2/2] libstdc++: Make the default ctor of mdspan conditionally noexcept.

2025-07-21 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 2:40 PM Jonathan Wakely wrote: > OK > Merged to trunk. > > On Mon, 21 Jul 2025, 12:10 Luc Grosheintz, > wrote: > >> Previously, the default ctor of mdspan was never noexcept, even if all >> members of mdspan were nothrow default constructible. >> >> This commit makes mds

Re: [PATCH v1 1/2] libstdc++: Strengthen exception guarantee for mdspan methods.

2025-07-21 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 2:45 PM Jonathan Wakely wrote: > > > On Mon, 21 Jul 2025, 12:08 Luc Grosheintz, > wrote: > >> The mdspan::is_{,always}_{unique,strided,exhaustive} methods only call >> their counterparts in mdspan::mapping_type. The standard specifies that >> the methods of mdspan::mappin

Re: [PATCH 2/2] libstdc++: Protect std::shared_ptr against counter overflow [PR71945]

2025-07-18 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 8:03 PM Jonathan Wakely wrote: > This adds a check when incrementing the shared count and weak count and > will trap if it overflows. This also double the effective range of the > counts for most 64-bit targets. > > The counter type, _Atomic_word, is usually a signed 32-bi

Re: [PATCH v3] libstdc++: Fixed localized empty-spec formatting for months/weekdays [PR121154]

2025-07-18 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 3:04 PM Jonathan Wakely wrote: > On 18/07/25 14:01 +0200, Tomasz Kamiński wrote: > >Previously for localized output, if _M_debug option was send, the > _M_check_ok > >completed succesfully and _M_locale_fmt was called for months/weekdays > that > >are !ok(). > > > >This pa

Re: [PATCHv2] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-18 Thread Tomasz Kaminski
On Fri, Jul 18, 2025 at 12:52 PM Nathan Myers wrote: > * I rewrote the implementation to more closely resemble the > non-NTTP version, and fix the various noexcept and requires > omissions. > I have a task to adjust them later, so the alignment may not be desired. > > * I don't understand wh

Re: [PATCH 2/2] libstdc++: Implement reverse iteration for _Utf_view

2025-07-18 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 7:02 PM Jonathan Wakely wrote: > This implements the missing functions in _Utf_iterator to support > reverse iteration. All existing tests pass when the view is reversed, so > that the same code units are seen when iterating forwards or backwards. > > libstdc++-v3/ChangeLo

Re: [PATCH v2] libstdc++: Add std::inplace_vector for C++26 (P0843R14) [PR119137]

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 10:39 PM Jonathan Wakely wrote: > On 17/07/25 15:23 -0400, Patrick Palka wrote: > >On Thu, 17 Jul 2025, Tomasz Kamiński wrote: > >> + constexpr inplace_vector& > >> + operator=(const inplace_vector& __other) > >> + noexcept(is_nothrow_copy_assignable_v<_Tp>

Re: [PATCH] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-17 Thread Tomasz Kaminski
I have left some comments on the previous revision here: https://gcc.gnu.org/pipermail/libstdc++/2025-July/062349.html They do not seem to be addressed. On Thu, Jul 17, 2025 at 9:13 PM Nathan Myers wrote: > [Note: many of the tests for the original versions do not make > sense, require different

Re: [PATCH 1/2] libstdc++: Optimize _Utf_iterator for size

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 7:03 PM Jonathan Wakely wrote: > This reorders the data members of _Utf_iterator to avoid padding bytes > between members due to alignment requirements. For x86_64 the previous > layout had padding after _M_buf and after _M_to_increment for the common > case where the iter

Re: [PATCH] libstdc++: Add std::inplace_vector for C++26 (P0843R14) [PR119137]

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 7:25 PM Patrick Palka wrote: > On Thu, 17 Jul 2025, Jonathan Wakely wrote: > > > On 17/07/25 11:26 -0400, Patrick Palka wrote: > > > On Thu, 17 Jul 2025, Tomasz Kamiński wrote: > > > > > > > From: Jonathan Wakely > > > > > > > > Implement std::inplace_vector as specified

Re: [PATCH v1 0/3] Fix custom IndexType related bugs in mdspan.

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 4:53 PM Luc Grosheintz wrote: > > > On 7/17/25 16:16, Tomasz Kaminski wrote: > > Thank you for the fast response and fixes. > > I will next week experiment with running libc++ test, so will confirm > here > > if they are all fixed. > >

Re: [PATCH v1 3/3] libstdc++: Implement aligned_accessor from mdspan.

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 11:57 AM Luc Grosheintz wrote: > > > On 7/8/25 17:37, Tomasz Kaminski wrote: > > On Thu, Jul 3, 2025 at 12:38 PM Luc Grosheintz > > > wrote: > > > >> This commit completes the implementation of P2897R7 by implementing and > >

Re: [PATCH v1] libstdc++: Implement std::dims.

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 9:09 AM Luc Grosheintz wrote: This commit implements the C++26 feature std::dims, sets the feature > testing macro to 202403 and adds tests. > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (mdspan): Set value for C++26. > * include/bits/version.h

Re: [PATCH v1 1/3] libstdc++: Implement is_sufficiently_aligned.

2025-07-17 Thread Tomasz Kaminski
As a note, you can force test to run in multiple/specific standard by using: > GLIBCXX_TESTSUITE_STDS=20,23 make check On Thu, Jul 17, 2025 at 12:57 PM Jonathan Wakely wrote: > On Thu, 17 Jul 2025 at 11:54, Jonathan Wakely wrote: > > > > On Thu, 17 Jul 2025 at 11:32, Luc Grosheintz wrote: > >

Re: [PATCH v1 3/3] libstdc++: Fix forwarding of custom IndexType in mdspan [PR121061]

2025-07-17 Thread Tomasz Kaminski
Also merged to master. On Wed, Jul 16, 2025 at 10:07 PM Jonathan Wakely wrote: > > > On Wed, 16 Jul 2025, 14:53 Luc Grosheintz, > wrote: > >> The second bug report in PR121061 is that the conversion of custom >> OtherIndexType to IndexType is incorrectly not done via r-value >> references. >> >

Re: [PATCH v1 0/3] Fix custom IndexType related bugs in mdspan.

2025-07-17 Thread Tomasz Kaminski
Thank you for the fast response and fixes. I will next week experiment with running libc++ test, so will confirm here if they are all fixed. On Wed, Jul 16, 2025 at 3:47 PM Luc Grosheintz wrote: > These three commits fix PR121061. The first prepares the tests, and then > the next two each fix on

Re: [PATCH v1 2/3] libstdc++: Fix constraint for custom integer types in mdspan [PR121061]

2025-07-17 Thread Tomasz Kaminski
This shows how useful refactoring for a test was. Thanks for posting. Just merged to master. On Wed, Jul 16, 2025 at 10:05 PM Jonathan Wakely wrote: > > > On Wed, 16 Jul 2025, 14:46 Luc Grosheintz, > wrote: > >> PR121061 consists of two bugs for mdspan related code. This commit fixes >> the fir

Re: [PATCH v1 1/3] libstdc++: Refactor mdspan tests [PR121061]

2025-07-17 Thread Tomasz Kaminski
Also LGTM, thanks for moving int_like.h to mdspan. Just pushed it to master. On Wed, Jul 16, 2025 at 10:04 PM Jonathan Wakely wrote: > > > On Wed, 16 Jul 2025, 14:48 Luc Grosheintz, > wrote: > >> PR121061 shows that the test coverage for custom integer types is >> insufficient. Custom IndexType

Re: [PATCH] libstdc++: Add std::inplace_vector for C++26 (P0843R14) [PR119137]

2025-07-17 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 3:41 PM Jakub Jelinek wrote: > On Thu, Jul 17, 2025 at 03:31:57PM +0200, Tomasz Kamiński wrote: > > From: Jonathan Wakely > > > > Implement std::inplace_vector as specified in P0843R14, without follow > > up papers, in particular P3074R7 (trivial unions). In consequence >

Re: [PATCH v2] libstdc++: Use __promote_3 for std::hypot [PR121097]

2025-07-16 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 1:19 AM Jonathan Wakely wrote: > The __promoted_t alias is only defined when __cpp_fold_expressions is > defined, which might not be the case for some hypothetical C++17 > compilers. > > Change the 3-arg std::hypot to just use __gnu_cxx::__promote_3 which is > always avail

Re: [PATCH v2] libstdc++: Add comments to __unicode::_Utf_iterator

2025-07-16 Thread Tomasz Kaminski
On Thu, Jul 17, 2025 at 1:16 AM Jonathan Wakely wrote: > Add comments documenting what it does and how it does it. > > Also reorder the if-else in operator++ so that we check whether to > iterate over code units in the local buffer before checking whether to > refill that buffer. That seems the m

Re: [PATCH] libstdc++: Add comments to __unicode::_Utf_iterator

2025-07-16 Thread Tomasz Kaminski
On Wed, Jul 16, 2025 at 2:06 PM Jonathan Wakely wrote: > On Wed, 16 Jul 2025 at 12:30, Tomasz Kaminski wrote: > > > > > > > > > > On Wed, Jul 16, 2025 at 12:05 PM Jonathan Wakely > wrote: > >> > >> Add comments documenting what it does and

Re: [PATCH] libstdc++: Add comments to __unicode::_Utf_iterator

2025-07-16 Thread Tomasz Kaminski
On Wed, Jul 16, 2025 at 12:05 PM Jonathan Wakely wrote: > Add comments documenting what it does and how it does it. > > Also reorder the if-else in operator++ so that we check whether to > iterate over code units in the local buffer before checking whether to > refill that buffer. That seems the

Re: [PATCH] libstdc++: Use basic_string_view for std::bitset deduced types

2025-07-16 Thread Tomasz Kaminski
On Wed, Jul 16, 2025 at 1:15 PM Jonathan Wakely wrote: > On Wed, 16 Jul 2025 at 11:47, Tomasz Kaminski wrote: > > > > > > > > On Wed, Jul 16, 2025 at 12:07 PM Jonathan Wakely > wrote: > >> > >> This change was part of by P2697R1 (Interfacing bits

Re: [PATCH] libstdc++, v2: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-07-16 Thread Tomasz Kaminski
On Wed, Jul 16, 2025 at 12:56 PM Jakub Jelinek wrote: > On Mon, Jul 14, 2025 at 12:11:18PM +0200, Tomasz Kaminski wrote: > > We have a preference to use [[likely]] attribute when possible. > > Done. > > > > + for (; __first != __

Re: [PATCH] libstdc++: Use basic_string_view for std::bitset deduced types

2025-07-16 Thread Tomasz Kaminski
On Wed, Jul 16, 2025 at 12:07 PM Jonathan Wakely wrote: > This change was part of by P2697R1 (Interfacing bitset with string_view) > and should be slightly cheaper to instantiate. > > libstdc++-v3/ChangeLog: > > * include/std/bitset (__bitset::__string) [__cpp_lib_bitset]: > Chang

Re: [PATCH] libstdc++: Define __promoted_t alias for C++17 without fold expressions [PR121097]

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 10:36 PM Jonathan Wakely wrote: > Define a fallback implementation of the __promoted_t alias for > hypothetical C++17 compilers which don't define __cpp_fold_expressions. > Without this, can't be compiled by such compilers, because the > 3-arg form of std::hypot uses the

Re: [PATCH] libstdc++/ranges: Prefer using offset-based _CachedPosition

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 9:51 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > -- >8 -- > > The offset-based partial specialization of _CachedPosition for > random-access iterators is currently only selected if the offset type is > smaller than the iterator

Re: [PATCH] libstdc++: Define std::nothrow as inline variable

2025-07-15 Thread Tomasz Kaminski
result for inline constexpr variables, by putting some compiler specific attributes on them? On Tue, Jul 15, 2025 at 1:37 PM Jonathan Wakely wrote: > On Tue, 15 Jul 2025 at 12:06, Tomasz Kaminski wrote: > > > > > > > > On Tue, Jul 15, 2025 at 12:37 PM Jonathan Wakely &g

Re: [PATCH v2] libstdc++: Conditionalize LWG 3569 changes to join_view

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 6:13 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk only > (since it impacts ABI)? > > Changes in v2: > > - Condition on forward_iterator instead of default_initializable. > > -- >8 -- > > LWG 3569 adjusted join_view's iterator specif

Re: [PATCH 2/2] libstdc++: Conditionalize LWG 3569 changes to join_view

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 5:43 PM Patrick Palka wrote: > On Tue, 15 Jul 2025, Tomasz Kaminski wrote: > > > > > > > On Tue, Jul 15, 2025 at 3:55 PM Patrick Palka wrote: > > On Tue, 15 Jul 2025, Tomasz Kaminski wrote: > > > > > On Tue, J

Re: [PATCH 2/2] libstdc++: Conditionalize LWG 3569 changes to join_view

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 3:55 PM Patrick Palka wrote: > On Tue, 15 Jul 2025, Tomasz Kaminski wrote: > > > On Tue, Jul 15, 2025 at 5:51 AM Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk only > > (since it impacts ABI)? >

Re: [PATCH v4 0/6] Implement mdspan.

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 12:56 PM Luc Grosheintz wrote: > > > On 7/14/25 08:57, Tomasz Kaminski wrote: > > Hi Luc, > > > > While running the libc++ test on libstdc++ we have found the following > > issue in our implementation. > > https://gcc.gnu.org/bugzil

Re: [PATCH v4 0/6] Implement mdspan.

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 1:35 PM Jonathan Wakely wrote: > OK here are the details for all of the failing tests ... > > std/containers/views/mdspan/aligned_accessor/access.pass.cpp > > std/containers/views/mdspan/aligned_accessor/ctor.conversion.from.default_accessor.pass.cpp > std/containers/views

Re: [PATCH] libstdc++: Make ranges::advance(it, n, bound) follow standard more strictly

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 11:56 AM Jonathan Wakely wrote: > On Tue, 15 Jul 2025 at 09:25, Tomasz Kaminski wrote: > > > > > > > > On Mon, Jul 14, 2025 at 10:43 PM Jonathan Wakely > wrote: > >> > >> The standard specifies some of the effects of range

Re: [PATCH] libstdc++: Define std::nothrow as inline variable

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 12:37 PM Jonathan Wakely wrote: > On Tue, 15 Jul 2025 at 08:10, Tomasz Kaminski wrote: > > > > > > > > On Mon, Jul 14, 2025 at 10:43 PM Jonathan Wakely > wrote: > >> > >> This makes it possible to use `new(std::nothrow)

Re: [PATCH 2/2] libstdc++: Conditionalize LWG 3569 changes to join_view

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 5:51 AM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk only > (since it impacts ABI)? > In theory an Iterator that meets all semantic requirements of the input_iterator concept, could provide a default constructor that is unconstrained, b

Re: [PATCH] libstdc++: Make all experimental::observer_ptr functions constexpr

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 2:00 PM Jonathan Wakely wrote: > I've just created LWG 4295 proposing this change, and am implementing it > via this patch. > > libstdc++-v3/ChangeLog: > > * include/experimental/memory (swap, make_observer_ptr): Add > constexpr. > (operator==, oper

Re: [PATCH] libstdc++: Make ranges::advance(it, n, bound) follow standard more strictly

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:43 PM Jonathan Wakely wrote: > The standard specifies some of the effects of ranges::advance in terms > of "Equivalent to:" and it's observable that our current implementation > deviates from the precise specification in the standard. This was > causing some failures i

Re: [PATCH] libstdc++: Ensure that ranges::destroy destroys in constexpr [PR121024]

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:41 PM Jonathan Wakely wrote: > The new test is currently marked as XFAIL because PR c++/102284 means > that GCC doesn't notice that the lifetimes have ended. > > libstdc++-v3/ChangeLog: > > PR libstdc++/121024 > * include/bits/ranges_uninitialized.h (ran

Re: [committed] libstdc++: Add comments to deleted std::swap overloads for LWG 2766

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:58 PM Jonathan Wakely wrote: > We pre-emptively implemented part of LWG 2766, which still hasn't been > approved. Add comments to the deleted swap overloads saying why they're > there, because the standard doesn't require them. > > libstdc++-v3/ChangeLog: > > *

Re: [PATCH] libstdc++: Constrain std::swap using concepts in C++20

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:38 PM Jonathan Wakely wrote: > This is a minor compile-time optimization for C++20. > Please mention that you also replaced _GLIBCXX20_CONSTEXPR, with constexpr under __glibcxx_concepts (that is >= c++ 20). Otherwise LGTM. > > libstdc++-v3/ChangeLog: > > * inc

Re: [PATCH 1/2] libstdc++: Add missing initializers for __maybe_present_t members [PR119962]

2025-07-15 Thread Tomasz Kaminski
On Tue, Jul 15, 2025 at 5:51 AM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps > 15? Not sure if this corner case is worth backporting any further. > > Can we just use direct-list-initialization via {} instead of '= T()' > here? I wasn't sure so I

Re: [PATCH] libstdc++: Define std::nothrow as inline variable

2025-07-15 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:43 PM Jonathan Wakely wrote: > This makes it possible to use `new(std::nothrow) X` without linking to > libsupc++ or libstdc++. > > To ensure we still export the symbol from the library we need to > suppress the inline variable in libsupc++/new_handler.cc which is done

Re: [PATCH 2/2] libstdc++: Ensure std::make_unsigned works for 128-bit enum

2025-07-14 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:35 PM Jonathan Wakely wrote: > libstdc++-v3/ChangeLog: > > * include/std/type_traits (__make_unsigned_selector): Add > unsigned __int128 to type list. > * testsuite/20_util/make_unsigned/int128.cc: New test. > --- > > Tested x86_64-linux. > LGTM.

Re: [PATCH 1/2] libstdc++: Ensure std::hash<__int128> is defined [PR96710]

2025-07-14 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 10:34 PM Jonathan Wakely wrote: > This is a follow-up to r16-2190-g4faa42ac0dee2c which ensures that > std::hash is always enabled for signed and unsigned __int128. The > standard requires std::hash to be enabled for all arithmetic types. > > libstdc++-v3/ChangeLog: > >

Re: [PATCH] libstdc++: Implement std::chrono::current_zone() for Windows

2025-07-14 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 1:47 PM Jonathan Wakely wrote: > On Mon, 14 Jul 2025 at 11:10, Jonathan Wakely wrote: > > > > On Mon, 14 Jul 2025 at 11:08, Björn Schäpers wrote: > > > > > > Am 14.07.2025 um 10:20 schrieb Tomasz Kaminski: > > > > > >

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-07-14 Thread Tomasz Kaminski
3:30 PM Tomasz Kaminski wrote: > > > On Tue, Jun 17, 2025 at 1:15 PM Jakub Jelinek wrote: > >> Hi! >> >> Here is a new version of the library side of the C++26 P2786R13 paper. >> For if constexpr the patch uses __builtin_constant_p trick to figure >> out if

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-07-14 Thread Tomasz Kaminski
On Tue, Jun 17, 2025 at 1:15 PM Jakub Jelinek wrote: > Hi! > > Here is a new version of the library side of the C++26 P2786R13 paper. > For if constexpr the patch uses __builtin_constant_p trick to figure > out if __result is non-equality comparable with __first, it adds recursion > for the is_ar

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-07-14 Thread Tomasz Kaminski
On Mon, Jul 14, 2025 at 12:23 PM Jakub Jelinek wrote: > On Mon, Jul 14, 2025 at 12:11:18PM +0200, Tomasz Kaminski wrote: > > > + if (__builtin_expect(__fwd, true)) > > > > > We have a preference to use [[likely]] attribute when possible. > > Ok, changed to &

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-07-14 Thread Tomasz Kaminski
On Tue, Jun 17, 2025 at 1:15 PM Jakub Jelinek wrote: > Hi! > > Here is a new version of the library side of the C++26 P2786R13 paper. > For if constexpr the patch uses __builtin_constant_p trick to figure > out if __result is non-equality comparable with __first, it adds recursion > for the is_ar

Re: [PATCH] libstdc++: Implement std::chrono::current_zone() for Windows

2025-07-14 Thread Tomasz Kaminski
On Tue, Jul 8, 2025 at 10:48 PM Björn Schäpers wrote: > From: Björn Schäpers > > I have based this on my previous (not yet landed) patch, but it only > reuses the #ifdef to include . Since std::array isn't used > anywhere else I thought that was the right place to put it. > > I hope the formatti

Re: [PATCH] libstdc++: Add more template keywords to for Clang

2025-07-14 Thread Tomasz Kaminski
I was going to ask why you haven't committed it directly, but it looks like it is already on master. LGTM. On Tue, Jul 8, 2025 at 11:34 PM Jonathan Wakely wrote: > This fixes: > > include/c++/16.0.0/mdspan:1182:33: error: use 'template' keyword to treat > 'mapping' as a dependent template name >

Re: [PATCH v4 0/6] Implement mdspan.

2025-07-13 Thread Tomasz Kaminski
_M_accessor = accessor_type(); [[no_unique_address]] mapping_type _M_mapping = mapping_type(); [[no_unique_address]] data_handle_type _M_handle = data_handle_type(); We do not want to use "{}" as the samantis is a bit differnt. Regards, Tomasz On Tue, Jul 8, 2025 at 3:44 PM Tomasz Kaminski wrot

Re: [PATCH] libstdc++: Do not use list-initialization in std::span members [PR120997]

2025-07-13 Thread Tomasz Kaminski
On Tue, Jul 8, 2025 at 11:46 PM Jonathan Wakely wrote: > As the bug report shows, for span the return statements of > the form `return {data(), count};` will use the new C++26 constructor, > span(initializer_list). > > Although the conversions from data() to bool and count to bool are > narrowing

Re: [PATCH v2 2/2] libstdc++: Better CTAD for span and mdspan [PR120914].

2025-07-08 Thread Tomasz Kaminski
On Tue, Jul 8, 2025 at 6:18 PM Luc Grosheintz wrote: > > > On 7/8/25 17:11, Tomasz Kaminski wrote: > > This was merged. Thanks for working on it. > > > > However, the constant_wrapper paper accepted in Sofia, modifies the > concept: > > https://www.open-std

Re: [PATCH v1 3/3] libstdc++: Implement aligned_accessor from mdspan.

2025-07-08 Thread Tomasz Kaminski
On Thu, Jul 3, 2025 at 12:38 PM Luc Grosheintz wrote: > This commit completes the implementation of P2897R7 by implementing and > testing the template class aligned_accessor. > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (aligned_accessor): Add. > * include/bits/versi

Re: [PATCH v2 2/2] libstdc++: Better CTAD for span and mdspan [PR120914].

2025-07-08 Thread Tomasz Kaminski
This was merged. Thanks for working on it. However, the constant_wrapper paper accepted in Sofia, modifies the concept: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2781r8.html On Tue, Jul 8, 2025 at 1:01 PM Tomasz Kaminski wrote: > Maybe adding a negative test for the error w

  1   2   3   4   5   6   >