Re: [PATCH] libstdc++: Optimize __make_comp_proj and __make_pred_proj for empty types

2025-06-13 Thread Tomasz Kaminski
On Fri, Jun 13, 2025 at 4:46 PM Patrick Palka wrote: > On Fri, 13 Jun 2025, Tomasz Kaminski wrote: > > > > > > > On Fri, Jun 13, 2025 at 3:54 PM Patrick Palka wrote: > > On Fri, 13 Jun 2025, Tomasz Kaminski wrote: > > > > > > >

Re: [PATCH] libstdc++: Optimize __make_comp_proj and __make_pred_proj for empty types

2025-06-13 Thread Tomasz Kaminski
On Fri, Jun 13, 2025 at 3:54 PM Patrick Palka wrote: > On Fri, 13 Jun 2025, Tomasz Kaminski wrote: > > > > > > > On Thu, Jun 12, 2025 at 9:05 PM Patrick Palka wrote: > > On Thu, 12 Jun 2025, Patrick Palka wrote: > > > > &g

Re: [PATCH] libstdc++: add a workaround for format_kind> [PR120644]

2025-06-13 Thread Tomasz Kaminski
LGTM, thanks. It's interesting that having deduced the return type caused an issue. On Fri, Jun 13, 2025 at 11:56 AM Giuseppe D'Angelo < giuseppe.dang...@kdab.com> wrote: > Hi, > > Attached is a workaround for > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120644 > > It looks it's a C++ fronten

Re: [PATCH v2] libstdc++: Fix std::uninitialized_value_construct for arrays [PR120397]

2025-06-13 Thread Tomasz Kaminski
On Fri, Jun 13, 2025 at 11:31 AM Jonathan Wakely wrote: > The std::uninitialized_{value,default}_construct{,_n} algorithms should > be able to create arrays, but that currently fails because when an > exception happens they clean up using std::_Destroy and in C++17 that > doesn't support destroyi

Re: [PATCH] libstdc++: Improve documentation on copyright notices in new tests

2025-06-13 Thread Tomasz Kaminski
On Wed, Jun 11, 2025 at 11:36 AM Jonathan Wakely wrote: > Clarify that FSF copyright notices in tests are incorrect for > contributions under DCO terms. Clarify the sentence about copying > existing tests to clarify that it is only referring to copying the code > in the test file, rather than jus

Re: [PATCH v4 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-13 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 7:33 PM Patrick Palka wrote: > On Thu, 12 Jun 2025, Patrick Palka wrote: > > > Changes in v4: > > * Don't pass a projection function throughout the helpers, instead > > create a pass a composite predicate via __make_comp_proj. > LGTM. > > > > -- >8 -- > > > > As wit

Re: [PATCH v4 1/2] libstdc++: Directly implement ranges::heap algos [PR100795]

2025-06-13 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 6:53 PM Patrick Palka wrote: > Changes in v4: > * Don't pass a projection function throughout the helpers, instead > create a pass a composite predicate via __make_comp_proj. > LGTM. > > -- >8 -- > > ranges::push_heap, ranges::pop_heap, ranges::make_heap and > range

Re: [PATCH] libstdc++: Optimize __make_comp_proj and __make_pred_proj for empty types

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 9:05 PM Patrick Palka wrote: > On Thu, 12 Jun 2025, Patrick Palka wrote: > > > On Thu, 12 Jun 2025, Jonathan Wakely wrote: > > > > > > > > > > > On Thu, 12 Jun 2025, 16:56 Patrick Palka, wrote: > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > >

Re: [PATCH v2 3/4] libstdc++: Format empty chrono-spec for the sys_info and local_info directly.

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 5:50 PM Jonathan Wakely wrote: > > > On Thu, 12 Jun 2025, 16:19 Tomasz Kamiński, wrote: > >> This patch change implementation of the formatters for sys_info and >> local_info, >> so they no longer delegate to operator<< for ostream in case of empty >> spec. >> As this typ

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 5:06 PM Patrick Palka wrote: > On Wed, 11 Jun 2025, Tomasz Kaminski wrote: > > > > > > > On Tue, Jun 10, 2025 at 3:08 AM Patrick Palka wrote: > > As with the previous patch, this patch reimplements ranges::sort > > direct

Re: [PATCH] libstdc++: Test chrono-spec containing only whitespaces.

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 4:48 PM Daniel Krügler wrote: > Am Do., 12. Juni 2025 um 16:40 Uhr schrieb Tomasz Kamiński < > tkami...@redhat.com>: > >> libstdc++-v3/ChangeLog: >> >> * testsuite/std/time/format/whitespace.cc: New test. >> --- >> Testing on x86_64-linux. OK for trunk when test pa

Re: [PATCH 1/2] libstdc++: Directly implement ranges::heap algos [PR100795]

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 4:56 PM Patrick Palka wrote: > On Wed, 11 Jun 2025, Tomasz Kaminski wrote: > > > > > > > On Wed, Jun 11, 2025 at 1:56 PM Jonathan Wakely > wrote: > > On Wed, 11 Jun 2025 at 12:42, Tomasz Kaminski > wrote: > > > &g

Re: [PATCH 3/4] libstdc++: Format empty chrono-spec for the sys_info and local_info directly.

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 3:22 PM Jonathan Wakely wrote: > On 06/06/25 12:41 +0200, Tomasz Kamiński wrote: > >This patch change implementation of the formatters for sys_info and > local_info, > >so they no longer delegate to operator<< for ostream in case of empty > spec. > >As this types may be on

Re: [PATCH] libstdc++: Fix std::uninitialized_value_construct for arrays [PR120397]

2025-06-12 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 12:13 AM Jonathan Wakely wrote: > The std::uninitialized_{value,default}_construct{,_n} algorithms should > be able to create arrays, but that currently fails because when an > exception happens they clean up using std::_Destroy and in C++17 that > doesn't support destroyi

Re: [PATCH v1] libstdc++: Implement default_accessor from mdspan.

2025-06-12 Thread Tomasz Kaminski
On Fri, Jun 6, 2025 at 5:41 PM Luc Grosheintz wrote: > > > On 6/6/25 14:12, Tomasz Kaminski wrote: > > On Thu, Jun 5, 2025 at 4:31 PM Luc Grosheintz > > wrote: > > > >> libstdc++-v3/ChangeLog: > >> > >> * include/std/mdspan (d

Re: [PATCH v5 0/8] Implement layouts from mdspan.

2025-06-12 Thread Tomasz Kaminski
Hi, I have landed all the layout patches on master. Thank you very much for your continued contributions. While submitting, I noticed that few of the commit messages do not match the format (space vs tabulator), and I fixed them up. and realized that I haven't shared tools that we use to automati

Re: [PATCH v2] libstdc++: hashing support for chrono value classes (P2592R2)

2025-06-12 Thread Tomasz Kaminski
We iterated the patched on the force: https://forge.sourceware.org/gcc/gcc-TEST/pulls/54/files The version present there now LGTM. On Mon, Jun 9, 2025 at 12:16 PM Tomasz Kaminski wrote: > > > On Fri, Jun 6, 2025 at 9:07 AM Giuseppe D'Angelo < > giuseppe.dang...@kdab.com>

Re: [PATCH] libstdc++: Do not specialize std::formatter for incomplete type [PR120625]

2025-06-11 Thread Tomasz Kaminski
On Thu, Jun 12, 2025 at 12:04 AM Jonathan Wakely wrote: > Using an incomplete type as the template argument for std::formatter > specializations causes problems for program-defined specializations of > std::formatter which have constraints. When the compiler has to find > which specialization of

Re: [PATCH 4/4] libstdc++: Rework formatting of empty chrono-spec for duration.

2025-06-11 Thread Tomasz Kaminski
On Fri, Jun 6, 2025 at 12:55 PM Tomasz Kamiński wrote: > In contrast to other calendar types if empty chron-spec is used for > duration > we are required to format it (and it's representation type) via ostream. > Handling this case was now moved to be part of the format function > for duration. T

Re: [PATCH] libstdc++: Test for precision and floting point durations.

2025-06-11 Thread Tomasz Kaminski
On Wed, Jun 11, 2025 at 4:07 PM Tomasz Kamiński wrote: > libstdc++-v3/ChangeLog: > > * testsuite/std/time/format/empty_spec.cc: New tests. > * testsuite/std/time/format/precision.cc: New test. > --- > Testing on x86_64-linux. OK for trunk when tests passes? > > .../testsuite/std/

Re: [RFC] Implement mdspan.

2025-06-11 Thread Tomasz Kaminski
Hi Luc, Just to set some expectations, next week we will be participating in C++ committee meeting, so my availability for review will be limited in the next two weeks. Regards, Tomasz On Wed, Jun 11, 2025 at 3:21 PM Luc Grosheintz wrote: > This patch completes the C++23 part of and must be a

Re: [PATCH v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 8:45 AM Luc Grosheintz wrote: > Same style error. > Will be included in my fixup commit. > > On 6/4/25 16:58, Luc Grosheintz wrote: > > Implements the remaining parts of layout_left and layout_right; and all > > of layout_stride. > > > > The implementation of layout_strid

Re: [PATCH v6 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 8:40 AM Luc Grosheintz wrote: > If not committed yet, there's a style error, see below. > Will be included in my fixup commit. > > On 6/4/25 16:58, Luc Grosheintz wrote: > > Implement the parts of layout_left that depend on layout_right; and the > > parts of layout_right

Re: [PATCH v2] libstdc++: add range support to std::optional (P3168)

2025-06-11 Thread Tomasz Kaminski
It should be sufficient to move only following to formatfwd.h to declare disabled specialization for optional. I do not think that we need to move to a partial specialization of format_kind for ranges. // [format.range], formatting of ranges + // [format.range.fmtkind], variable template format_

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 3:08 AM Patrick Palka wrote: > As with the previous patch, this patch reimplements ranges::sort > directly instead of incorrectly forwarding to std::sort. In addition to > the compatibility changes listed in the previous patch we also: > > - use ranges::iter_swap instea

Re: [PATCH 1/2] libstdc++: Directly implement ranges::heap algos [PR100795]

2025-06-11 Thread Tomasz Kaminski
On Wed, Jun 11, 2025 at 1:56 PM Jonathan Wakely wrote: > On Wed, 11 Jun 2025 at 12:42, Tomasz Kaminski wrote: > > > > > > > > On Tue, Jun 10, 2025 at 3:05 AM Patrick Palka wrote: > >> > >> ranges::push_heap, ranges::pop_heap, ranges::make_heap and

Re: [PATCH 1/2] libstdc++: Directly implement ranges::heap algos [PR100795]

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 3:05 AM Patrick Palka wrote: > ranges::push_heap, ranges::pop_heap, ranges::make_heap and > ranges::sort_heap are currently defined in terms of the corresponding > STL-style algorithms, but this is incorrect because the STL-style > algorithms rely on the legacy iterator sy

Re: [PATCH v2] libstdc++: Simplify __uninitialized_default and __uninitialized_default_n

2025-06-11 Thread Tomasz Kaminski
On Wed, Jun 11, 2025 at 1:14 PM Jonathan Wakely wrote: > With improved memset optimizations in std::uninitialized_fill and > std::uninitialized_fill_n (see r15-4473-g3abe751ea86e34), we can make > the non-standard internal helpers __uninitialized_default and > __uninitialized_default_n use those

Re: [PATCH] libstdc++: Improve diagnostics for ill-formed std::_Destroy and std::_Destroy_n [PR120390]

2025-06-11 Thread Tomasz Kaminski
On Wed, Jun 11, 2025 at 11:39 AM Jonathan Wakely wrote: > On Wed, 11 Jun 2025 at 10:24, Tomasz Kaminski wrote: > > > > > > > > On Tue, Jun 10, 2025 at 12:37 PM Jonathan Wakely > wrote: > >> > >> By using std::is_trivially_destructible instead o

Re: [PATCH] libstdc++: Simplify __uninitialized_default and __uninitialized_default_n

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 6:17 PM Jonathan Wakely wrote: > With improved memset optimizations in std::uninitialized_fill and > std::uninitialized_fill_n (see r15-4473-g3abe751ea86e34), we can make > the non-standard internal helpers __uninitialized_default and > __uninitialized_default_n use those

Re: [PATCH] libstdc++: Improve diagnostics for ill-formed std::_Destroy and std::_Destroy_n [PR120390]

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 12:37 PM Jonathan Wakely wrote: > By using std::is_trivially_destructible instead of the old > __has_trivial_destructor built-in we no longer need the static_assert to > deal with types with deleted destructors. All non-destructible types, > including those with deleted de

Re: [PATCH] libstdc++: Fix new tests for COW std::string ABI

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 12:37 PM Jonathan Wakely wrote: > The std::basic_stringbuf::get_allocator() member is only available for > the SSO std::string ABI. > > libstdc++-v3/ChangeLog: > > * testsuite/27_io/basic_istringstream/cons/char/string_view.cc: > Only check get_allocator()

Re: [PATCH] libstdc++: Implement LWG3528 make_from_tuple can perform (the equivalent of) a C-style cast

2025-06-10 Thread Tomasz Kaminski
On Mon, Jun 9, 2025 at 4:07 PM Jonathan Wakely wrote: > From: Yihan Wang > > Implement LWG3528 to make std::make_from_tuple SFINAE friendly. > > libstdc++-v3/ChangeLog: > > * include/std/tuple (__can_make_from_tuple): New variable > template. > (__make_from_tuple_impl): A

Re: [PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2025-06-10 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 5:22 AM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > LGTM. I think this change makes sense, and we should consider requiring that in standard. For example, with reflections, this allows reflect_constant to store distance for all rang

Re: [PATCH 1/4] libstdc++: Format empty chrono-spec for the calendar types directly.

2025-06-09 Thread Tomasz Kaminski
On Fri, Jun 6, 2025 at 1:02 PM Tomasz Kamiński wrote: > This patch change implementation of the formatters for the calendar types, > so they no longer delegate to operator<< for ostream in case of empty > chrono-spec. > Instead of that, we define the behavior of the in terms of format > specifier

Re: [PATCH v2] libstdc++: hashing support for chrono value classes (P2592R2)

2025-06-09 Thread Tomasz Kaminski
sourceware.org/gcc/gcc-TEST/pulls/52 Posted review there, but major change is, for type that are wrappers over integer: * use hash to hash a value, instead of jus returning it * specialize __is_fash_hash as true for them. > > > > On 24/04/2025 15:30, Tomasz Kaminski wrote: > &g

Re: [PATCH] libstdc++: Adjust effective-target requirements for and

2025-06-06 Thread Tomasz Kaminski
On Fri, Jun 6, 2025 at 3:13 PM Jonathan Wakely wrote: > These features depend on __cpp_lib_atomic_wait which is not available > for freestanding, and is available when either gthreads is supported, or > the target is linux (for futex support). > > libstdc++-v3/ChangeLog: > > * testsuite/3

Re: [PATCH v1] libstdc++: Implement default_accessor from mdspan.

2025-06-06 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 4:31 PM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan (default_accessor): New class. > * src/c++23/std.cc.in: Register default_accessor. > * testsuite/23_containers/mdspan/default_accessor.cc: New test. > > Signed-off-by: L

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 11:09 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 18:58, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 6:44 PM Jonathan Wakely > wrote: > >> > >> On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski > wro

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 6:44 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely > wrote: > >> > >> On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski > wro

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for local_info and sys_info.

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 5:19 PM Tomasz Kamiński wrote: > We do not test with wchar_t currently, as operator<< (and format) are > ill-formed in such case, because we do not widen abbrev member of > local_info. > > Adding a tests for behavior of the ostream operator and the formatting > with empty c

Re: [PATCH] libstdc++: Test for formatting with empty spec for local_info and sys_info.

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 4:46 PM Tomasz Kamiński wrote: > We do not test with wchar_t currently, as operator<< (and format) are > ill-formed in such case, because we do not widen abbrev member of > local_info. > > Adding a tests for behavior of the ostream operator and the formatting > with empty c

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely > wrote: > >> > >> Rename __semaphore_base to __semaphore_impl, because

Re: [PATCH v6 0/8] Implement layouts from mdspan.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:06 PM Luc Grosheintz wrote: > The previous iteration can be found here: > https://gcc.gnu.org/pipermail/libstdc++/2025-May/061781.html > > Changes since v5: > > * Fixed tests on 32-bit systems. > * Expand tests to check absense of UB while multiplying dynamic > ex

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

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:23 PM 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 v6 7/8] libstdc++: Add tests for layout_stride.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:26 PM Luc Grosheintz wrote: > Implements the tests for layout_stride and for the features of the other > two layouts that depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests fo

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely wrote: > Rename __semaphore_base to __semaphore_impl, because it's not used as a > base class. Replace the three identical lambda expressions with a named > class, __semaphore_impl::_Can_acquire, which stores the most recent > value of the counter a

Re: [PATCH 2/2] libstdc++: Add assertions to atomic waiting functions that need platform wait

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 12:10 AM Jonathan Wakely wrote: > These overloads should never be used for proxy waits, so add assertions > to ensure that they aren't used accidentally. > > The reason they can't be used is that they don't call > __args._M_setup_wait to obtain a __wait_state pointer. Even

Re: [PATCH v6 5/8] libstdc++: Add tests for layout_right.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:16 PM Luc Grosheintz wrote: > Adds tests for layout_right and for the parts of layout_left that depend > on layout_right. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests for layout_right. >

Re: [PATCH v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 8:15 AM Daniel Krügler wrote: > Am Mi., 4. Juni 2025 um 17:18 Uhr schrieb Luc Grosheintz < > luc.groshei...@gmail.com>: > >> Implements the remaining parts of layout_left and layout_right; and all >> of layout_stride. >> >> The implementation of layout_stride::mapping::is_e

Re: [PATCH v6 3/8] libstdc++: Add tests for layout_left.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:15 PM Luc Grosheintz wrote: > Implements a suite of tests for the currently implemented parts of > layout_left. The individual tests are templated over the layout type, to > allow reuse as more layouts are added. > > libstdc++-v3/ChangeLog: > > * testsuite/23_cont

Re: [PATCH v6 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:09 PM Luc Grosheintz wrote: > Implement the parts of layout_left that depend on layout_right; and the > parts of layout_right that don't depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_right): New class. > * src/c++23/

Re: [committed] libstdc++: Skip time zone format testing for COW std::string

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 11:04 PM Jonathan Wakely wrote: > This is needed when testing with -D_GLIBCXX_USE_CXX11_ABI=0 to fix: > FAIL: std/time/format/empty_spec.cc -std=gnu++20 (test for excess errors) > > libstdc++-v3/ChangeLog: > > * testsuite/std/time/format/empty_spec.cc: Only test ti

Re: [PATCH v6 2/8] libstdc++: Implement layout_left from mdspan.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:02 PM Luc Grosheintz wrote: > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_left): New class. > * src/c++23/std.cc.in: Add layout_left. > > Signed-off-by: L

Re: [PATCH v6 1/8] libstdc++: Improve naming, whitespace and silence warnings for extents.

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:01 PM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan(__mdspan::_ExtentsStorage): Change name > of private member _M_dynamic_extens to _M_dyn_exts. > * include/std/mdspan(extents): Change name of private member > fr

Re: [PATCH] libstdc++: Fix std::format thousands separators when sign present [PR120548]

2025-06-05 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 8:47 PM Jonathan Wakely wrote: > The leading sign character should be skipped when deciding whether to > insert thousands separators into a floating-point format. > > libstdc++-v3/ChangeLog: > > PR libstdc++/120548 > * include/std/format (__formatter_fp::_M_

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:45 PM Luc Grosheintz wrote: > > > On 6/4/25 15:38, Tomasz Kaminski wrote: > > On Wed, Jun 4, 2025 at 2:19 PM Tomasz Kaminski > wrote: > > > >> > >> > >> On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz > > >>

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for time points.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 4:04 PM Jonathan Wakely wrote: > On 04/06/25 13:06 +0200, Tomasz Kamiński wrote: > >Adding a tests for behavior of the ostream operator and the formatting > >with empty chronio-spec for the chrono types. Current coverage is: > > * time point, zoned_time and local_time_forma

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 2:19 PM Tomasz Kaminski wrote: > > > On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz > wrote: > >> >> >> On 6/4/25 13:19, Tomasz Kaminski wrote: >> > Ah, sorry I got confused in the review suggestions, and latter when &g

Re: [PATCH 4/4] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-04 Thread Tomasz Kaminski
I would prefer design when we have a platform_semaphore_base that is defined only if _GLIBCXX_HAVE_PLATFORM_WAIT, and semaphore_base. For the platform_semaphore, this could you binary_semaphore code, with two modification: static constexpr ptrdiff_t _S_max = _Binary ? 1 : numeric_limits::Max;

Re: [PATCH 3/4] libstdc++: Optimize std::binary_semaphore

2025-06-04 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 6:06 PM Jonathan Wakely wrote: > On Tue, 3 Jun 2025 at 09:46, Jonathan Wakely wrote: > > > > This adds a new implementation of std::counting_semaphore for the > > case where Max == 1, i.e. the std::binary_semaphore typedef. When the > > maximum counter value is 1 we don't n

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz wrote: > > > On 6/4/25 13:19, Tomasz Kaminski wrote: > > Ah, sorry I got confused in the review suggestions, and latter when > > checking the code. > > What I meant is: > > > > Because the incoming strided_la

Re: [PATCH 2/4] libstdc++: Refactor __semaphore_base member functions

2025-06-04 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 10:32 AM Jonathan Wakely wrote: > Replace the _S_get_current and _S_do_try_acquire static member functions > with non-static member functions _M_get_current and _M_do_try_acquire. > This means they don't need the address of _M_counter passed in. > > libstdc++-v3/ChangeLog:

Re: [PATCH 1/4] libstdc++: Fix std::counting_semaphore::acquire deadlock [PR104928]

2025-06-04 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 10:34 AM Jonathan Wakely wrote: > There's a deadlock in std::counting_semaphore that occurs when the > semaphore is under contention. The bug happens when one thread tries to > acquire the mutex, calling __semaphore_base::_S_do_try_acquire to > atomically decrement the coun

Re: [PATCH v5 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 1:40 PM Luc Grosheintz wrote: > > > On 6/3/25 14:49, Tomasz Kaminski wrote: > > On Fri, May 30, 2025 at 6:47 PM Luc Grosheintz > > > wrote: > > > >> Implements the remaining parts of layout_left and layout_right; and all > >>

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for time points.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 1:08 PM Tomasz Kamiński wrote: > Adding a tests for behavior of the ostream operator and the formatting > with empty chronio-spec for the chrono types. Current coverage is: > This should say "chron-spec", consider it to be fixed locally. > * time point, zoned_time and loc

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 1:19 PM Tomasz Kaminski wrote: > Ah, sorry I got confused in the review suggestions, and latter when > checking the code. > What I meant is: > > Because the incoming strided_layout is required to be unique, > that implies that for each of strides are g

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
rt(!cmp_less(numeric_limits::max(), __other.required_span_size())); } On Wed, Jun 4, 2025 at 1:09 PM Luc Grosheintz wrote: > > > On 6/3/25 15:24, Tomasz Kaminski wrote: > > On Fri, May 30, 2025 at 6:44 PM Luc Grosheintz > > > wr

Re: [PATCH] libstdc++: Fix format call and test formatting with empty specs for durations.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 1:06 PM Daniel Krügler wrote: > Am Mi., 4. Juni 2025 um 12:57 Uhr schrieb Tomasz Kaminski < > tkami...@redhat.com>: > >> >> >> On Wed, Jun 4, 2025 at 12:43 PM Daniel Krügler >> wrote: >> >>> Am Mi., 4. Juni

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 12:36 PM Luc Grosheintz wrote: > > > On 6/3/25 15:10, Tomasz Kaminski wrote: > > On Tue, Jun 3, 2025 at 2:50 PM Luc Grosheintz > > wrote: > > > >> > >> > >> On 6/3/25 14:31, Tomasz Kaminski wrote: > >>

Re: [PATCH] libstdc++: Fix format call and test formatting with empty specs for durations.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 12:43 PM Daniel Krügler wrote: > Am Mi., 4. Juni 2025 um 11:27 Uhr schrieb Tomasz Kamiński < > tkami...@redhat.com>: > >> This patches fixes an obvious error, where the output iterator argument >> was >> missing for call to format_to, when duration with custom representatio

Re: [PATCH v5 0/8] Implement layouts from mdspan.

2025-06-04 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 6:56 PM Luc Grosheintz wrote: > Thank you Tomasz for the round of review. IIUC we have several > cases of if there's a v6, please change this, and no mandatory > changes. > > Would you like me to submit a v6? > If you could fix to the test on 32bit architectures, that would

Re: [PATCH] libstdc++: Support _TIME_BITS=64 for system_clock::to_time_t [PR99832]

2025-06-04 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 7:53 PM Jonathan Wakely wrote: > > > On Tue, 3 Jun 2025, 16:07 Tomasz Kaminski, wrote: > >> >> >> On Tue, Jun 3, 2025 at 4:40 PM Jonathan Wakely >> wrote: >> >>> On Tue, 3 Jun 2025 at 14:46, Jonathan Wakely wrote:

Re: [PATCH] libstdc++: Support _TIME_BITS=64 for system_clock::to_time_t [PR99832]

2025-06-03 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 4:40 PM Jonathan Wakely wrote: > On Tue, 3 Jun 2025 at 14:46, Jonathan Wakely wrote: > > > > For some 32-bit targets Glibc supports changing the size of time_t to be > > 64 bits by defining _TIME_BITS=64. That causes an ABI change which > > would affect std::chrono::system

Re: [PATCH] libstdc++: Support _TIME_BITS=64 for system_clock::to_time_t [PR99832]

2025-06-03 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 3:46 PM Jonathan Wakely wrote: > For some 32-bit targets Glibc supports changing the size of time_t to be > 64 bits by defining _TIME_BITS=64. That causes an ABI change which > would affect std::chrono::system_clock::to_time_t. Because to_time_t is > not a function template

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

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:48 PM 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 n

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:44 PM Luc Grosheintz wrote: > Implements the tests for layout_stride and for the features of the other > two layouts that depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests f

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-03 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 2:50 PM Luc Grosheintz wrote: > > > On 6/3/25 14:31, Tomasz Kaminski wrote: > > On Mon, Jun 2, 2025 at 9:07 AM Luc Grosheintz > > wrote: > > > >> > >> > >> On 5/30/25 18:42, Luc Grosheintz wrote: > >>>

Re: [PATCH v5 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:47 PM Luc Grosheintz wrote: > Implements the remaining parts of layout_left and layout_right; and all > of layout_stride. > > The implementation of layout_stride::mapping::is_exhaustive applies > the following change to the standard: > > 4266. layout_stride::mapping sh

Re: [PATCH v5 5/8] libstdc++: Add tests for layout_right.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:50 PM Luc Grosheintz wrote: > Adds tests for layout_right and for the parts of layout_left that depend > on layout_right. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests for layout_right. >

Re: [PATCH v5 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:49 PM Luc Grosheintz wrote: > Implement the parts of layout_left that depend on layout_right; and the > parts of layout_right that don't depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_right): New class. > * src/c++23

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 9:07 AM Luc Grosheintz wrote: > > > On 5/30/25 18:42, Luc Grosheintz wrote: > > Implements a suite of tests for the currently implemented parts of > > layout_left. The individual tests are templated over the layout type, to > > allow reuse as more layouts are added. > > > >

Re: [PATCH] libstdc++: Use new __is_destructible built-in in

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 10:56 PM Jonathan Wakely wrote: > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_destructible, is_destructible_v): > Define using new built-in. > (is_nothrow_destructible, is_nothrow_destructible_v): Likewise. > (is_trivially_destr

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:52 PM Luc Grosheintz wrote: > Implements a suite of tests for the currently implemented parts of > layout_left. The individual tests are templated over the layout type, to > allow reuse as more layouts are added. > > libstdc++-v3/ChangeLog: > > * testsuite/23_con

Re: [PATCH v5 2/8] libstdc++: Implement layout_left from mdspan.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:47 PM Luc Grosheintz wrote: > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_left): New class. > * src/c++23/std.cc.in: Add layout_left. > > Signed-off-by:

Re: [PATCH v5 1/8] libstdc++: Improve naming, whitespace and silence warnings for extents.

2025-06-03 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 6:45 PM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan(__mdspan::_ExtentsStorage): Change name > of private member _M_dynamic_extens to _M_dyn_exts. > * include/std/mdspan(extents): Change name of private member > f

Re: [PATCH] libstdc++: Fix incorrect comments on atomic timed waits

2025-06-03 Thread Tomasz Kaminski
With the change to the title, this looks good to me. On Tue, Jun 3, 2025 at 12:02 PM Tomasz Kaminski wrote: > The tile says that you are doing only comment fixes, while there is code > change > in __spin_until_impl. Could you please adjust it: > Fix incorrect returns and commen

Re: [PATCH] libstdc++: Fix errors in atomic timed waiting functions

2025-06-03 Thread Tomasz Kaminski
On Tue, Jun 3, 2025 at 12:02 PM Jonathan Wakely wrote: > On Tue, 3 Jun 2025 at 09:38, Tomasz Kaminski wrote: > > > > > > > > On Mon, Jun 2, 2025 at 10:59 PM Jonathan Wakely > wrote: > >> > >> These function templates are apparently never used

Re: [PATCH] libstdc++: Fix incorrect comments on atomic timed waits

2025-06-03 Thread Tomasz Kaminski
The tile says that you are doing only comment fixes, while there is code change in __spin_until_impl. Could you please adjust it: Fix incorrect returns and comments on atomic timed waits On Mon, Jun 2, 2025 at 7:24 PM Jonathan Wakely wrote: > The __detail::__wait_until function has a comment tha

Re: [PATCH] libstdc++: Replace some implicit conversions in std::vector

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 7:33 PM Jonathan Wakely wrote: > This replaces two implicit conversions from ptrdiff_t to size_t with > explicit conversions that include unreachable hints for the ptrdiff_t > value not being negative. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_vector.h (~_V

Re: [PATCH] libstdc++: Fix errors in atomic timed waiting functions

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 10:59 PM Jonathan Wakely wrote: > These function templates are apparently never used or instantiated, > because they don't compile. This fixes them, but they're still unused. > I plan to make use of them in a later commit. > > libstdc++-v3/ChangeLog: > > * include/b

Re: [PATCH] libstdc++: Use explicit cast to unsigned in std::rotr and std::rotl

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 7:28 PM Jonathan Wakely wrote: > This suppresses some -Wsign-conversion warnings from Clang when > compiling with -Wsystem-headers. > > libstdc++-v3/ChangeLog: > > * include/std/bit (__rotl, __rotr): Use static_cast for > conversion from int to unsigned. > -

Re: [PATCH] libstdc++: Remove redundant macro checks in std.cc.in

2025-06-03 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 7:25 PM Jonathan Wakely wrote: > __cpp_lib_any and __cpp_lib_chrono are defined unconditionally in C++20 > and __cpp_lib_three_way_comparison and __cpp_lib_concepts depend on > front-end features which are definitely supported by GCC trunk. > > libstdc++-v3/ChangeLog: > >

Re: [PATCH] libstdc++: Fix formatting of 3-digits months, day, weekday and hour [PR120481]

2025-06-02 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 1:21 PM Tomasz Kamiński wrote: > This patch fixes the handle multiple digits values for the month, day, > weekday > and hour, when used with the %m, %d, %e, %m, %u, %w, %H, and %D, %F > specifiers. > The values are now printed unmodified. This patch also fixes printing > n

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

2025-05-30 Thread Tomasz Kaminski
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 formatting > > with empty chron-spec for the chrono types. This commit covers calendar > > types. > > > > libstdc++-v3/

Re: [PATCH v4 6/8] libstdc++: Implement layout_stride from mdspan.

2025-05-30 Thread Tomasz Kaminski
On Fri, May 30, 2025 at 12:01 PM Luc Grosheintz wrote: > > > On 5/29/25 10:07, Tomasz Kaminski wrote: > > On Thu, May 29, 2025 at 9:23 AM Tomasz Kaminski > wrote: > > > >> > >> > >> > >> On Mon, May 26, 2025 at 4:1

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

2025-05-30 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 10:38 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. > This is the simplest case, and can just compare adjacent elements of > the input range. > > - Ne

Re: [PATCH] libstdc++: Define flat_set::operator== in terms of ==

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 7:14 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > -- >8 -- > > ... for consistency with the other standard container adaptors > (stack, queue, etc). > > libstdc++-v3/ChangeLog: > > * include/std/flat_set (_Flat_set_im

Re: [PATCH v4 0/8] Implement layouts from mdspan.

2025-05-29 Thread Tomasz Kaminski
Sending a bit after the fact, but: I have finished the review, and most of the commits have really minimal cosmetic changes. The only major functional one I have requested are for layout_stride implementation, On Wed, May 28, 2025 at 4:36 PM Tomasz Kaminski wrote: > I have reviewed and pos

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

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 4:49 PM Jonathan Wakely wrote: > 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 P

  1   2   3   4   >