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

2025-07-17 Thread Jonathan Wakely
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> +&& is_nothrow_copy_constructible_v<_Tp>) + { +

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

2025-07-17 Thread Jonathan Wakely
On 17/07/25 13:25 -0400, 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: > > + > > +namespace std _GLIBCXX_VISIBILITY(default) > > +{ > > +_GLIB

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

2025-07-17 Thread Jonathan Wakely
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 in P0843R14, without follow up papers, in particular P3074R7 (trivial unions). In consequence inplace_vector can be used inside constant

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

2025-07-17 Thread Jonathan Wakely
On 17/07/25 13:06 -0400, Patrick Palka wrote: On Thu, 17 Jul 2025, Jonathan Wakely wrote: On 17/07/25 15:31 +0200, Tomasz Kamiński wrote: > From: Jonathan Wakely > > Implement std::inplace_vector as specified in P0843R14, without follow > up papers, in particular P3074R7 (trivial

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

2025-07-17 Thread Jonathan Wakely
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/ChangeLog: * include/bits/unicode.h (_Utf_iterator::operator--):

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

2025-07-17 Thread Jonathan Wakely
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 iterators and sentinel types are pointers, so the size shrinks from 4

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

2025-07-17 Thread Jonathan Wakely
On 17/07/25 15:31 +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 inplace_vector can be used inside constant evaluations only if T is trivial of N is

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

2025-07-17 Thread Jonathan Wakely
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 in P0843R14, without follow up papers, in particular P3074R7 (trivial unions). In consequence inplace_vector can be used inside constant

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

2025-07-17 Thread Jonathan Wakely
On 17/07/25 15:31 +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 inplace_vector can be used inside constant evaluations only if T is trivial of N is

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

2025-07-17 Thread Jonathan Wakely
On Thu, 17 Jul 2025 at 08:11, Luc Grosheintz wrote: > > This commit implements the C++26 feature std::dims, sets the feature > testing macro to 202403 and adds tests. This should be 202406 > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (mdspan): Set value for C++26. >

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

2025-07-17 Thread Jonathan Wakely
On Thu, 17 Jul 2025 at 15:59, Tomasz Kaminski wrote: > The standard just says that this is UB, so we are testing something that is > not > required to pass by the standard. This is why I am a bit hesitant on death > tests like that. > Jonathan, do you have an opinion on this? If we have an asser

[committed] libstdc++: Document change in __int128 traits [PRPR96710]

2025-07-17 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR libstdc++/96710 * doc/xml/manual/evolution.xml: Document change or __int128. * doc/html/manual/api.html: Regenerate. --- Pushed to trunk. libstdc++-v3/doc/html/manual/api.html | 3 +++ libstdc++-v3/doc/xml/manual/evolution.xml | 5 + 2

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

2025-07-17 Thread Jonathan Wakely
On Thu, 17 Jul 2025 at 11:54, Jonathan Wakely wrote: > > On Thu, 17 Jul 2025 at 11:32, Luc Grosheintz wrote: > > > > Thank you! This uncovered a misconception of mine, namely that > > > > { target c++17 } > > > > would automatically run on C++17 and

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

2025-07-17 Thread Jonathan Wakely
On Thu, 17 Jul 2025 at 11:32, Luc Grosheintz wrote: > > Thank you! This uncovered a misconception of mine, namely that > > { target c++17 } > > would automatically run on C++17 and all later versions. Which is > true, by accident, for { target c++23 }. At least in my rather > default config it

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

2025-07-17 Thread Jonathan Wakely
On Thu, 17 Jul 2025 at 10:05, Luc Grosheintz wrote: > > > > On 7/8/25 16:56, Tomasz Kaminski wrote: > > On Thu, Jul 3, 2025 at 12:36 PM Luc Grosheintz > > wrote: > > > >> This commit implements and tests the function is_sufficiently_aligned > >> from P2897R7. > >> > >> libstdc++-v3/ChangeLog: > >

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

2025-07-16 Thread Jonathan Wakely
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 available. libstdc++-v3/ChangeLog: PR libstdc++/121097

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

2025-07-16 Thread Jonathan Wakely
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 more natural way to structure the function. libstdc++-v3/ChangeLog

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

2025-07-16 Thread Jonathan Wakely
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. > > This commit fixes the forwarding issue, adds a custom IndexType called > RValueInt, which only

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

2025-07-16 Thread Jonathan Wakely
On Wed, 16 Jul 2025, 14:46 Luc Grosheintz, wrote: > PR121061 consists of two bugs for mdspan related code. This commit fixes > the first one. Namely, when passing custom IndexType as an array or > span, the conversion to int must be const. Prior to this commit the > constraint incorrectly also al

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

2025-07-16 Thread Jonathan Wakely
On Wed, 16 Jul 2025, 14:48 Luc Grosheintz, wrote: > PR121061 shows that the test coverage for custom integer types is > insufficient. Custom IndexTypes are passed to mdspan related objects in > one of two ways: > > * as a template parameter pack, > * or as an array/span. > > These two cases h

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

2025-07-16 Thread Jonathan Wakely
On Wed, 16 Jul 2025 at 15:00, Luc Grosheintz wrote: > > > > On 7/15/25 13:43, Tomasz Kaminski wrote: > > On Tue, Jul 15, 2025 at 1:35 PM Jonathan Wakely wrote: > > > >> OK here are the details for all of the failing tests ... > >> > >> std/conta

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

2025-07-16 Thread Jonathan Wakely
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 how it does it. >> >> Also reorder the if-else in operator++ so that we check whether to

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

2025-07-16 Thread Jonathan Wakely
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 bitset with string_view) >> and should be slightly cheaper to instantiate

Re: [PATCH] libstdc++: Do not define __cpp_lib_constexpr_exceptions [PR121114]

2025-07-16 Thread Jonathan Wakely
On Wed, 16 Jul 2025 at 10:54, Tomasz Kamiński wrote: > > Do not advertise library support for constexpr exceptions, as our > solution to throwing by __throw_* functions from , > caues constant evaluation to fail, as these functions are not constexpr. > > PR libstdc++/121114 > > libstdc++-v

[PATCH] libstdc++: Constrain bitset(const CharT*) constructor [PR121046]

2025-07-16 Thread Jonathan Wakely
Asking std::is_constructible_v, NonTrivial*> gives an error, rather than answering the query. The problem is that the constructor for std::bitset("010101") is not constrained to only accept pointers to char-like types, and for the second parameter (which has a default argument) std::basic_string_vi

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

2025-07-16 Thread Jonathan Wakely
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]: Change alias to refer to basic_string_view instead. --- Tested x86_64-linu

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

2025-07-16 Thread Jonathan Wakely
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 more natural way to structure the function. libstdc++-v3/ChangeLog

Re: [PATCH] libstdc++: provide debug impl of P2697 ctor [PR119742]

2025-07-16 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 08:20, Jonathan Wakely wrote: > > > > On Tue, 8 Jul 2025, 08:04 Tomasz Kaminski, wrote: >> >> LGTM. Thanks. >> >> On Mon, Jul 7, 2025 at 11:09 PM Nathan Myers wrote: >>> >>> This adds the new bitset constructor from st

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

2025-07-15 Thread Jonathan Wakely
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 alias. libstdc++-v3/ChangeLog: PR libstdc++/121097

[committed v2] libstdc++: Constrain std::swap using concepts in C++20

2025-07-15 Thread Jonathan Wakely
This is a minor compile-time optimization for C++20. libstdc++-v3/ChangeLog: * include/bits/move.h (swap): Replace enable_if with concepts when available, and with __enable_if_t alias otherwise. --- Here's what I pushed. Tested x86_64-linux. libstdc++-v3/include/bits/move.h |

[committed] libstdc++: Tweak dg-error patterns for C++26 constexpr changes

2025-07-15 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * testsuite/25_algorithms/copy/debug/constexpr_neg.cc: * testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc: * testsuite/25_algorithms/equal/debug/constexpr_neg.cc: * testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_

Re: [PATCH] c++, libstdc++, v5: Implement C++26 P3068R5 - constexpr exceptions [PR117785]

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 13:55, Jakub Jelinek wrote: > > On Tue, Jul 15, 2025 at 08:30:33AM -0400, Jason Merrill wrote: > > > The diagnostic only changed for C++26, and I'm not sure why (the _S_at > > > function isn't constexpr, so why wasn't it failing there before?) > > > > In C++23, we could see

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 12:44, Tomasz Kaminski wrote: > > > > 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 >> st

Re: [PATCH] c++, libstdc++, v5: Implement C++26 P3068R5 - constexpr exceptions [PR117785]

2025-07-15 Thread Jonathan Wakely
On Thu, 10 Jul 2025 at 09:06, Jakub Jelinek wrote: > > On Wed, Jul 09, 2025 at 06:45:41PM -0400, Jason Merrill wrote: > > > + && reduced_constant_expression_p (val)) > > > > And a value doesn't need to be constant to be printable, we should be able > > to print it unconditionally. > > Sure, the

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 12:06, Tomasz Kaminski wrote: > > > > 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 Jona

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

2025-07-15 Thread Jonathan Wakely
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/mdspan/aligned_accessor/ctor.conversion.pass.cpp std/containers/vie

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 12:26, Jonathan Wakely wrote: > > On Tue, 15 Jul 2025 at 11:57, Luc Grosheintz wrote: > > > > > > > > On 7/14/25 08:57, Tomasz Kaminski wrote: > > > Hi Luc, > > > > > > While running the libc++ test on libstdc++ we h

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 11:57, 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/bugzilla/show_bug.cgi?id=121061 > > Would you be

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

2025-07-15 Thread Jonathan Wakely
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) X` without linking to >> libsupc++ or libstdc++. >> >> To ensure we still exp

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 08:26, 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 and perhaps >> 15? Not sure if this corner case is worth backporting any further. >> >> Can we just use direct-list-i

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

2025-07-15 Thread Jonathan Wakely
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 ranges::advance in terms >> of "Equivalent to:" and it's observable that ou

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

2025-07-15 Thread Jonathan Wakely
On Tue, 15 Jul 2025 at 08:29, Tomasz Kaminski wrote: > > > > 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

Re: [PATCH] libstdc++: Format %a/%A/%b/%h/%B/%p without using locale::classic [PR110739]

2025-07-14 Thread Jonathan Wakely
On Mon, 7 Jul 2025 at 16:06, Tomasz Kamiński wrote: > > With changes r16-2063-g8ad5968a8dcb47 the _M_a_A, _M_b_B and _M_p functions > are called only if the locale is equal to the locale::classic(), for which > the behavior is know. This patch changes they implementation, so instead of > reffering

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

2025-07-14 Thread Jonathan Wakely
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: * include/bits/stl_pair.h (swap): Add comment to deleted overloa

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

2025-07-14 Thread Jonathan Wakely
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 by defining a macro. libstdc++-v3/ChangeLog: * libsupc++/

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

2025-07-14 Thread Jonathan Wakely
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 (ranges::destroy): Do not optimize away trivial destructors during

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

2025-07-14 Thread Jonathan Wakely
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 in the libc++ testsuite. For the sized_sentinel_for case I optimiz

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

2025-07-14 Thread Jonathan Wakely
This is a minor compile-time optimization for C++20. libstdc++-v3/ChangeLog: * include/bits/move.h (swap): Replace enable_if with concepts when available, and with __enable_if_t alias otherwise. --- Tested powerpc64le-linux. libstdc++-v3/include/bits/move.h | 30 +++

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

2025-07-14 Thread Jonathan Wakely
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. libstdc++-v3/include/std/type_traits | 7 ++- .../testsuit

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

2025-07-14 Thread Jonathan Wakely
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: PR libstdc++/96710 * include/bits/functional_hash.h (has

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

2025-07-14 Thread Jonathan Wakely
On Mon, 14 Jul 2025 at 16:52, Tomasz Kaminski wrote: > > > > 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: >>

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

2025-07-14 Thread Jonathan Wakely
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==, operator!=, operator<, operator>, operator<=) (operator>=): Likewis

[committed] libstdc++: Protect PSTL headers against overloaded commas

2025-07-14 Thread Jonathan Wakely
Reported upstream: https://github.com/uxlfoundation/oneDPL/issues/2342 libstdc++-v3/ChangeLog: * include/pstl/algorithm_impl.h (__for_each_n_it_serial): Protect against overloaded comma operator. (__brick_walk2): Likewise. (__brick_walk2_n): Likewise. (__br

[committed] libstdc++: Correct value of __cpp_lib_constexpr_exceptions [PR117785]

2025-07-14 Thread Jonathan Wakely
Only P3068R6 (Allowing exception throwing in constant-evaluation) is implemented in the library so far, so the value of the constexpr_exceptions feature test macro should be 202411L. Once we support the library changes in P3378R2 (constexpr exception types) then we can set the value to 202502L agai

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

2025-07-14 Thread Jonathan Wakely
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: > > > > > > > > > On Tue, Jul 8, 2025 at 10:48 PM Björn Schäpers wrote: > > >

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

2025-07-14 Thread Jonathan Wakely
On Mon, 14 Jul 2025 at 11:08, Björn Schäpers wrote: > > Am 14.07.2025 um 10:20 schrieb Tomasz Kaminski: > > > > > > On Tue, Jul 8, 2025 at 10:48 PM Björn Schäpers > > wrote: > > > > From: Björn Schäpers mailto:bjo...@hazardy.de>> > > > > I have based this on my pre

[wwwdocs] Remove contribute.html text about including ChangeLog in the patch

2025-07-13 Thread Jonathan Wakely
--- This is an anachronism: ChangeLog entries should never be part of the patch, because nobody should be editing them locally and including them in a commit. Whether you can self-approve or not isn't relevant. OK for wwwdocs? htdocs/contribute.html | 5 ++--- 1 file changed, 2 insertions(+), 3

Re: [PATCH] middle-end: Fix typo in gimple.h

2025-07-13 Thread Jonathan Wakely
On 13/07/25 07:50 +, Benjamin Wu wrote: 2025-07-13 Ben Wu * gimple.h (GTMA_DOES_GO_IRREVOCABLE): Fix typo. Tested on x86_64-pc-linux-gnu. Will someone be able to commit this typo fix for me? The patch doesn't apply, because of the ChangeLog part. Please do *not* include changes to

Re: [PATCH v2] libstdc++: implement Philox Engine [PR119794]

2025-07-11 Thread Jonathan Wakely
On Fri, 11 Jul 2025 at 18:12, Jonathan Wakely wrote: > > > +static constexpr std::array multipliers = > > > + philox_engine::__popMultArray(); > > > +static constexpr std::array round_consts = > > > + philox_engine::__popConstArray(); &

Re: [PATCH v2] libstdc++: implement Philox Engine [PR119794]

2025-07-11 Thread Jonathan Wakely
On Fri, 11 Jul 2025 at 17:30, Patrick Palka wrote: > > Hi, > > On Thu, 22 May 2025, 1nfocalypse wrote: > > > Implements Philox Engine (P2075R6) and associated tests. > > > > v2 corrects a multiline comment left in error in serialize.cc, and > > additionally corrects a bug hidden by said comment,

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

2025-07-11 Thread Jonathan Wakely
On 10/07/25 09:48 +0200, Björn Schäpers wrote: From: Björn Schäpers On Windows there is no API to get the current time zone as IANA name, instead Windows has its own zones. But there exists a mapping provided by the Unicode Consortium. This patch adds a script to convert the XML file with the m

[PATCH v2] libstdc++: Fix constexpr exceptions for -fno-exceptions

2025-07-11 Thread Jonathan Wakely
The if-consteval branches in std::make_exception_ptr and std::exception_ptr_cast use a try-catch block, which gives an error for -fno-exceptions. Just make them return a null pointer at compile-time when -fno-exceptions is used, because there's no way to get an active exception with -fno-exceptions

Re: [PATCH] libstdc++: Fix constexpr exceptions for -fno-exceptions

2025-07-11 Thread Jonathan Wakely
On Fri, 11 Jul 2025 at 14:19, Jakub Jelinek wrote: > > On Fri, Jul 11, 2025 at 01:47:18PM +0100, Jonathan Wakely wrote: > Thanks for doing this. > > > @@ -301,8 +301,9 @@ namespace std _GLIBCXX_VISIBILITY(default) > > _GLIBCXX26_CONSTEXPR exception_ptr > >

Re: [PATCH] libstdc++: Fix constexpr exceptions for -fno-exceptions

2025-07-11 Thread Jonathan Wakely
On Fri, 11 Jul 2025 at 14:21, Jakub Jelinek wrote: > > On Fri, Jul 11, 2025 at 02:11:05PM +0100, Jonathan Wakely wrote: > > On Fri, 11 Jul 2025 at 14:02, Jonathan Wakely wrote: > > > > > > The if-consteval branches in std::make_exception_ptr and > > >

Re: [PATCH] libstdc++: Fix constexpr exceptions for -fno-exceptions

2025-07-11 Thread Jonathan Wakely
On Fri, 11 Jul 2025 at 14:02, Jonathan Wakely wrote: > > The if-consteval branches in std::make_exception_ptr and > std::exception_ptr_cast use a try-catch block, which gives an error for > -fno-exceptions. Just make them return a null pointer at compile-time > when -fno-exc

[PATCH] libstdc++: Fix constexpr exceptions for -fno-exceptions

2025-07-11 Thread Jonathan Wakely
The if-consteval branches in std::make_exception_ptr and std::exception_ptr_cast use a try-catch block, which gives an error for -fno-exceptions. Just make them return a null pointer at compile-time when -fno-exceptions is used, because there's no way to get an active exception with -fno-exceptions

Re: [PATCH] c++, libstdc++, v5: Implement C++26 P3068R5 - constexpr exceptions [PR117785]

2025-07-11 Thread Jonathan Wakely
I think we want something like this: --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -297,10 +297,13 @@ namespace std _GLIBCXX_VISIBILITY(default) /// Obtain an exception_ptr pointing to a copy of the supplied object. #if (__cplusplus >= 201103L && __

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

2025-07-10 Thread Jonathan Wakely
On Wed, 9 Jul 2025 at 20:21, Björn Schäpers wrote: > > Am 09.07.2025 um 16:16 schrieb Jonathan Wakely: > > On Wed, 9 Jul 2025 at 15:13, Jonathan Wakely wrote: > >> > >> On Tue, 8 Jul 2025 at 21:47, Björn Schäpers wrote: > >>> index 9923d14b7a7..bfbba07

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

2025-07-09 Thread Jonathan Wakely
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 directly instead of using std::fill and std::fill_n respectively.

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

2025-07-09 Thread Jonathan Wakely
On Wed, 9 Jul 2025 at 15:13, Jonathan Wakely wrote: > > On Tue, 8 Jul 2025 at 21:47, 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::

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

2025-07-09 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 21:47, 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 formatting

[wwwdocs] Add some C++23 and C++26 library features to GCC 16 release notes

2025-07-09 Thread Jonathan Wakely
Also thank Tomasz for std::format range support in GCC 15 --- Pushed to wwwdocs. htdocs/gcc-15/changes.html | 2 +- htdocs/gcc-16/changes.html | 21 - 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html inde

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

2025-07-09 Thread Jonathan Wakely
On Thu, 3 Jul 2025 at 11:35, Luc Grosheintz wrote: > > This commit implements and tests the function is_sufficiently_aligned > from P2897R7. > > libstdc++-v3/ChangeLog: > > * include/bits/align.h (is_sufficiently_aligned): New function. > * include/bits/version.def (is_sufficiently

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

2025-07-09 Thread Jonathan Wakely
Pushed to trunk now - thanks for contributing this! On Tue, 8 Jul 2025 at 18:32, Paul Keir wrote: > > Thanks Jonathan. > > > ____ > From: Jonathan Wakely > Sent: 08 July 2025 1:37 PM > To: Paul Keir > Cc: gcc-patches@gcc.gnu

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-09 Thread Jonathan Wakely
gt;> In the unit-tests for integer-class types I've defined variable template >> verify_numeric_limits_values_not_meaningful_for<> to avoid code duplication >> and have clear and readable code. I hope this is OK. >> >> Thanks, Mateusz Zych >> >>

[PATCH 1/2] libstdc++: Treat __int128 as a real integral type [PR96710]

2025-07-09 Thread Jonathan Wakely
Since LWG 3828 (included in C++23) implementations are allowed to have extended integer types that are wider than intmax_t. This means we no longer have to make is_integral_v<__int128> false for strict -std=c++23 mode, removing the confusing inconsistency with -std=gnu++23 (where is_integral_v<__in

[PATCH 2/2] libstdc++: Always treat __float128 as a floating-point type

2025-07-09 Thread Jonathan Wakely
Similar to the previous commit that made is_integral_v<__int128> unconditionally true, this makes is_floating_point_v<__float128> unconditionally true. With the new extended floating-point types in C++23 (std::float64_t etc.) it seems unhelpful for is_floating_point_v to be true for them, but not f

Re: [PATCH] libstdc++: Ensure pool resources meet alignment requirements [PR118681]

2025-07-09 Thread Jonathan Wakely
On Wed, 9 Jul 2025 at 10:10, Jonathan Wakely wrote: > > On Wed, 9 Jul 2025 at 09:51, Andreas Schwab wrote: > > > > This breaks several cross compilers: > > > > ../../../../../libstdc++-v3/src/c++17/memory_resource.cc: In member > > f

[committed] libstdc++: Fix memory_resource.cc bootstrap failure for non-gthreads targets

2025-07-09 Thread Jonathan Wakely
The new choose_block_size function added in r16-2112-gac2fb60a67d6d1 was defined inside an #ifdef _GLIBCXX_HAS_GTHREADS group, which means that it's not available for single-threaded targets, and so can't be used by unsynchronized_pool_resource. Move it before that preprocessor group so it's always

Re: [PATCH] libstdc++: Ensure pool resources meet alignment requirements [PR118681]

2025-07-09 Thread Jonathan Wakely
On Wed, 9 Jul 2025 at 09:51, Andreas Schwab wrote: > > This breaks several cross compilers: > > ../../../../../libstdc++-v3/src/c++17/memory_resource.cc: In member function > 'virtual void* > std::pmr::unsynchronized_pool_resource::do_allocate(std::size_t, > std::size_t)': > ../../../../../libs

[committed] libstdc++: Fix double free in new pool resource test [PR118681]

2025-07-08 Thread Jonathan Wakely
This was supposed to free p1 and p2, not free p2 twice. libstdc++-v3/ChangeLog: PR libstdc++/118681 * testsuite/20_util/unsynchronized_pool_resource/118681.cc: Fix deallocate argument. --- Tested x86_64-linux. Pushed to trunk. Thanks to Daniel Boles for noticing this.

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

2025-07-08 Thread Jonathan Wakely
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 and should be ill-formed, in system headers the narrowing diagnosti

[PATCH] libstdc++: Fix __uninitialized_default for constexpr case

2025-07-08 Thread Jonathan Wakely
We should not use the std::fill optimization for trivial types during constant evaluation, because we need to begin the lifetime of all objects, even trivially default constructible ones. This fixes a bug that Clang diagnosed: include/c++/16.0.0/bits/stl_algobase.h:925:11: note: assignment to obj

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

2025-07-08 Thread Jonathan Wakely
This fixes: include/c++/16.0.0/mdspan:1182:33: error: use 'template' keyword to treat 'mapping' as a dependent template name 1182 | const typename _OLayout::mapping<_OExtents>&> |^ include/c++/16.0.0/mdspan:1185:31: error: use 'template

Re: [PATCH] libstdc++: Ensure pool resources meet alignment requirements [PR118681]

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 14:12, Tomasz Kaminski wrote: > > > > On Tue, Jul 8, 2025 at 2:48 PM Jonathan Wakely wrote: >> >> On Tue, 8 Jul 2025 at 13:31, Tomasz Kaminski wrote: >> > >> > >> > >> > On Sat, Jul 5, 2025 at 1:12 AM J

Re: [PATCH] libstdc++: Ensure pool resources meet alignment requirements [PR118681]

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 14:12, Tomasz Kaminski wrote: > > > > On Tue, Jul 8, 2025 at 2:48 PM Jonathan Wakely wrote: >> >> On Tue, 8 Jul 2025 at 13:31, Tomasz Kaminski wrote: >> > >> > >> > >> > On Sat, Jul 5, 2025 at 1:12 AM J

Re: [PATCH] libstdc++: Ensure pool resources meet alignment requirements [PR118681]

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 13:31, Tomasz Kaminski wrote: > > > > On Sat, Jul 5, 2025 at 1:12 AM Jonathan Wakely wrote: >> >> For allocations with size > alignment and size % alignment != 0 we were >> sometimes returning pointers that did not meet the requested alig

Re: [PATCH] libstdc++: Fix attribute order on __normal_iterator friends [PR120949]

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 13:26, Tomasz Kaminski wrote: > > > > On Sat, Jul 5, 2025 at 1:27 AM Jonathan Wakely wrote: >> >> In r16-1911-g6596f5ab746533 I claimed to have reordered some attributes >> for compatibility with Clang, but it looks like I got the Clang >>

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

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 13:24, Jonathan Wakely wrote: > > On Tue, 8 Jul 2025 at 12:54, Paul Keir wrote: > > > > Let me know if this needs a refresh. > > The patch fails to apply: > > error: patch failed: libstdc++-v3/include/bits/shared_ptr_base.h:1715 >

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

2025-07-08 Thread Jonathan Wakely
mail client munging whitespace, not something that can be fixed by rebasing on trunk. I'll figure it out and apply it by hand. > > > From: Paul Keir > Sent: 06 June 2025 5:32 PM > To: Jonathan Wakely > Cc: gcc-patches@gcc.gnu.org; l

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

2025-07-08 Thread Jonathan Wakely
On Mon, 7 Jul 2025 at 11:12, Jonathan Wakely wrote: > > On Sat, 5 Jul 2025 at 14:03, François Dumont wrote: > > > > On 01/07/2025 22:51, Jonathan Wakely wrote: > > > On Mon, 16 Jun 2025 at 18:36, François Dumont > > > wrote: > > >> I eventuall

Re: [PATCH v2 1/2] libstdc++: Silence a warning in a test for span.

2025-07-08 Thread Jonathan Wakely
OK On Tue, 8 Jul 2025 at 10:50, Luc Grosheintz wrote: > > In a test of span, there's an unused variable myspan. This > commit silences the warning. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/span/contiguous_range_neg.cc: Silence > warning about unused variable myspa

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

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 11:46, Tomasz Kaminski wrote: > > > > On Tue, Jul 8, 2025 at 12:08 PM Jonathan Wakely wrote: >> >> On Tue, 8 Jul 2025 at 10:54, Luc Grosheintz wrote: >> > >> > This implements P3029R1. In P3029R1, the CTAD for span is refined to &

Re: [PATCH v2] libstdc++: Search for tzdata on Windows (msys)

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 11:31, Björn Schäpers wrote: > > Am 08.07.2025 um 12:01 schrieb Jonathan Wakely: > > On Mon, 7 Jul 2025 at 23:53, Björn Schäpers wrote: > >> > >> From: Björn Schäpers > >> > >> Windows does not provide a tzdata.zi, but msys d

Re: [PATCH] libstdc++: Do not expose set_brackets/set_separator for formatter with format_kind other than sequence [PR119861]

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 09:23, Tomasz Kamiński wrote: > > The standard defines separate specializations of range-default-formatter, out > of which only one for range_format::sequence provide the set_brackets and > set_separator methods. We implemented it as one specialization and exposed > this meth

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

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 10:54, Luc Grosheintz wrote: > > This implements P3029R1. In P3029R1, the CTAD for span is refined to > permit deducing the extent of the span from an integral constant, e.g. > > span((T*) ptr, integral_constant{}); > > is deduced as span. Similarly, in > > auto exts = ex

Re: [PATCH v2] libstdc++: Search for tzdata on Windows (msys)

2025-07-08 Thread Jonathan Wakely
On Mon, 7 Jul 2025 at 23:53, Björn Schäpers wrote: > > From: Björn Schäpers > > Windows does not provide a tzdata.zi, but msys does. Use this, if > available, instead of the embedded (and possibly outdated) database. > > libstdc++-v3/Changelog: > > Use msys provided time zone information.

Re: [PATCH v2] libstdc++: Search for tzdata on Windows (msys)

2025-07-08 Thread Jonathan Wakely
On Mon, 7 Jul 2025 at 23:53, Björn Schäpers wrote: > > From: Björn Schäpers > > Windows does not provide a tzdata.zi, but msys does. Use this, if > available, instead of the embedded (and possibly outdated) database. > > libstdc++-v3/Changelog: > > Use msys provided time zone information.

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

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 09:26, Luc Grosheintz wrote: > > Patches 1/5 ... 4/5 aren't sent because corresponding commits from v3 > should be used. The changes for 5/5 are: > > * Fix ADL issue in swap and create tests. > * Replace pragma once with include guard in layout_like.h. > * Use VERIFY(md

Re: [PATCH v4 5/6] libstdc++: Implement mdspan and tests [PR107761].

2025-07-08 Thread Jonathan Wakely
On Tue, 8 Jul 2025 at 09:26, Luc Grosheintz wrote: > > Implements the class mdspan as described in N4950, i.e. without P3029. > It also adds tests for mdspan. This commit completes the implementation > of P0009, i.e. the C++23 part . > > PR libstdc++/107761 > > libstdc++-v3/ChangeLog: > >

  1   2   3   4   5   6   7   8   9   10   >