[PATCH v2] libstdc++: Update tzdata to 2023d

2024-01-13 Thread Jonathan Wakely
On Fri, 12 Jan 2024 at 22:59, Jonathan Wakely wrote: > > It would be good to update the bundled tzdata for GCC 14.1 and 13.3 The expiry date for the hardcoded leapseconds list should be updated too, as there's a new date in the file in the tzdata distro. There are no new leap seconds t

Re: [PATCH] libstdc++: Make PSTL algorithms accept C++20 iterators [PR110512]

2024-01-13 Thread Jonathan Wakely
On Sat, 13 Jan 2024 at 09:36, Pilar Latiesa wrote: > > Hi Jonathan > > Thanks so much for implementing this. > > There are a couple of typos in the patch description: > 's/C==17RandomAccessIterator/Cpp17RandomAccessIterator/' and > 's/__or_/__and_/'. Thanks for the comments, I'll fix those. >

[PATCH v2] libstdc++: Implement C++26 std::text_encoding [PR113318]

2024-01-13 Thread Jonathan Wakely
Patch v2, with more tests. This fixes a bug in lookup by name where if an alias was matched then the aliases() view wouldn't contain the primary name or other aliases earlier in the table. It also optimizes text_encoding::environment_is so it constructs an encoding by ID and then only matches the

Re: [PATCH] libsupc++: Fix UB terminating on foreign exception

2024-01-13 Thread Jonathan Wakely
On Sun, 14 Jan 2024, 01:36 Julia DeMille, wrote: > On 1/13/24 19:17, Andrew Pinski wrote: > > 2 things, changelogs go into the email message rather than directly as > > part of the patch., > The reason for this is that the ChangeLog files are auto-generated from the git commit messages, not edit

Re: [PATCH] libstdc++: Implement P2255R2 dangling checks for std::tuple [PR108822]

2024-01-15 Thread Jonathan Wakely
On Mon, 15 Jan 2024 at 16:27, Patrick Palka wrote: > > On Sat, 13 Jan 2024, Jonathan Wakely wrote: > > > On Sat, 13 Jan 2024 at 00:06, Patrick Palka wrote: > > > > > > On Fri, 12 Jan 2024, Jonathan Wakely wrote: > > > > > > &

Re: [PATCH v2] libstdc++: Update tzdata to 2023d

2024-01-15 Thread Jonathan Wakely
On Sat, 13 Jan 2024 at 11:18, Jonathan Wakely wrote: > > On Fri, 12 Jan 2024 at 22:59, Jonathan Wakely wrote: > > > > It would be good to update the bundled tzdata for GCC 14.1 and 13.3 > > The expiry date for the hardcoded leapseconds list should be updated > too, a

[committed] libstdc++: Use variable template to fix -fconcepts-ts error [PR113366]

2024-01-15 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- There's an error for -fconcepts-ts due to using a concept where a bool NTTP is required, which is fixed by using the vraiable template that already exists in the class scope. This doesn't fix the problem with -fconcepts-ts as changes to the placemen

Re: [PATCH] libstdc++: Implement P2255R2 dangling checks for std::tuple [PR108822]

2024-01-15 Thread Jonathan Wakely
On Mon, 15 Jan 2024 at 16:51, Jonathan Wakely wrote: > > On Mon, 15 Jan 2024 at 16:27, Patrick Palka wrote: > > > > On Sat, 13 Jan 2024, Jonathan Wakely wrote: > > > > > On Sat, 13 Jan 2024 at 00:06, Patrick Palka wrote: > > > > >

Re: [PATCH] libstdc++: Implement P2836R1 changes to const_iterator

2024-01-15 Thread Jonathan Wakely
On Mon, 15 Jan 2024 at 18:50, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/13? OK for both, thanks. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_iterator.h (const_iterator): Define > conversion operators as per P2836R1. > * in

Re: [PATCH] libstdc++: reduce std::variant template instantiation depth

2024-01-15 Thread Jonathan Wakely
On Mon, 15 Jan 2024 at 19:32, Patrick Palka wrote: > > On Sun, Jan 7, 2024 at 3:33 PM Patrick Palka wrote: > > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > Ping. Huh, I thought I'd already approved this ... sorry. OK for trunk, with the -ftemplate-depth test change too.

[PATCH v3] libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]

2024-01-15 Thread Jonathan Wakely
I think I'm happy with this now. It has tests for all the new functions, and the performance of the charset alias match algorithm is improved by reusing part of . Tested x86_64-linux. -- >8 -- This is another C++26 change, approved in Varna 2022. We require a new static array of data that is ext

[PATCH v4] libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]

2024-01-16 Thread Jonathan Wakely
On 15/01/24 19:09 -0500, Patrick Palka wrote: On Mon, 15 Jan 2024, Jonathan Wakely wrote: I think I'm happy with this now. It has tests for all the new functions, and the performance of the charset alias match algorithm is improved by reusing part of . Tested x86_64-linux. -- >8 --

Re: [PATCH] libstdc++: Implement P2540R1 change to views::cartesian_product()

2024-01-16 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 14:39, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/13? Oh! I thought this went in as part of the original cartesian_product commit. I would have asked you to do it at the same time otherwise, sorry. Yes, OK for trunk and gcc-13, thank

Re: [PATCH v4] libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]

2024-01-16 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 14:07, Jonathan Wakely wrote: > > On 15/01/24 19:09 -0500, Patrick Palka wrote: > >> +friend _Iterator > >> +operator+(_Iterator __i, difference_type __n) > > > >constexpr? > > Fixed. I've added tests that all iterator

Re: [PATCH v4] libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]

2024-01-16 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 15:39, Jonathan Wakely wrote: > > On Tue, 16 Jan 2024 at 14:07, Jonathan Wakely wrote: > > > > On 15/01/24 19:09 -0500, Patrick Palka wrote: > > >> +friend _Iterator > > >> +operator+(_Iterator __i, difference_type __n)

[PATCH] libstdc++: Do not use CTAD for _Utf32_view alias template

2024-01-16 Thread Jonathan Wakely
Tested aarch64-linux. I plan to push this to fix an error when using trunk with Clang. -- >8 -- We were relying on P1814R0 (CTAD for alias templates) which isn't supported by Clang. We can just not use CTAD and provide an explicit template argument list for _Utf32_view. Ideally we'd define a ded

Re: [PATCH] libstdc++/ranges: Define _S_has_simple_call_op on newer adaptors

2024-01-16 Thread Jonathan Wakely
On Wed, 17 Jan 2024, 02:37 Patrick Palka, wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > OK > -- >8 -- > > This compile-time and diagnostic improvement[1] is less important in > C++23 mode where deducing this is available and used in _Pipe, but for > benefit of C++20 m

Re: [PATCH 01/14] c++: Implement __is_integral built-in trait

2024-01-16 Thread Jonathan Wakely
On Wed, 17 Jan 2024 at 00:31, Jason Merrill wrote: > > On 1/10/24 04:22, Ken Matsui wrote: > > +/* Return true if T is an integral type. With __STRICT_ANSI__, __int128 > > and > > + unsigned __int128 are not integral types. */ > > This really needs a rationale, since they are actually integer

Re: [PATCH 1/2] libstdc++/tuple: Guard P2321R2 changes with __cpp_lib_ranges_zip

2024-01-16 Thread Jonathan Wakely
On Wed, 17 Jan 2024 at 02:40, Patrick Palka wrote: > > Guard additions from P2321R2 zip with __cpp_lib_ranges_zip > instead of __cplusplus > 202020L. Ah yes, I should have changed all of these in r14-7225-gf8a5298c97c460 OK for trunk, thanks. > > libstdc++-v3/ChangeLog: > > * include/s

Re: [PATCH 2/2] libstdc++/pair: Guard P2321R2 changes with __glibcxx_ranges_zip

2024-01-16 Thread Jonathan Wakely
On Wed, 17 Jan 2024 at 02:41, Patrick Palka wrote: > > Similar to the previous change for , but since stl_pair.h is an > internal header we need to use the corresponding internal macro instead. OK thanks. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_pair.h [__cplusplus > 202002L]:

Re: [PATCH] libstdc++: hashtable: No need to update before begin node in _M_remove_bucket_begin

2024-01-17 Thread Jonathan Wakely
On Wed, 17 Jan 2024, 08:14 Huanghui Nie via Gcc, wrote: > Thanks. Done. > And don't CC the main gcc@ list, that's not for patch discussion. And if you CC the right list, you don't need to CC the individual maintainers. Anyway, it's on the right list now so we'll review it there, thanks. > 20

Re: [PATCH] libstdc++: Do not use CTAD for _Utf32_view alias template

2024-01-17 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 21:28, Jonathan Wakely wrote: > > Tested aarch64-linux. I plan to push this to fix an error when using > trunk with Clang. Pushed. > > -- >8 -- > > We were relying on P1814R0 (CTAD for alias templates) which isn't > supported by Clang. We c

[committed v5] libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]

2024-01-17 Thread Jonathan Wakely
Here's the final version that I pushed. Tested aarch64-linux, x86_64-linux. commit df0a668b784556fe4317317d58961652d93d53de Author: Jonathan Wakely Date: Mon Jan 15 15:42:50 2024 libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318] This is another C++26 c

Re: [PATCH] libstdc++: Fix constexpr _Safe_iterator in C++20 mode

2024-01-18 Thread Jonathan Wakely
On Thu, 18 Jan 2024 at 02:48, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? Please add PR109536 to the commit message. > > -- >8 -- > > Some _Safe_iterator member functions define a variable of non-literal > type __gnu_cxx::__scoped_lock, which automatical

[wwwdocs] Document new additions to libstdc++

2024-01-18 Thread Jonathan Wakely
Pushed to wwwdocs. -- >8 -- std::generator, std::format improvements, std::text_encoding. --- htdocs/gcc-14/changes.html | 10 ++ 1 file changed, 10 insertions(+) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 5644de1e..951d005b 100644 --- a/htdocs/gcc-14/cha

[committed] libstdc++: Fix std::format test for Solaris [PR113450]

2024-01-18 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- When int8_t is a typedef for char (rather than signed char) this test fails because it tries to format a char, which is treated differently from formatting other integral types (including signed char). Use signed char explicitly so the result doesn'

[committed] libstdc++: Avoid -Wmaybe-uninitialized warnings in text_encoding.cc

2024-01-18 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- These variables are only read from if we haven't reached the end of either range, in which case they're guaranteed to be initialized to the next alphanumeric character. But we can just initialize them to make the compiler happy. libstdc++-v3/ChangeL

Re: [PATCH] libstdc++: Fix constexpr _Safe_iterator in C++20 mode

2024-01-18 Thread Jonathan Wakely
On Thu, 18 Jan 2024 at 13:51, Patrick Palka wrote: > > On Thu, 18 Jan 2024, Jonathan Wakely wrote: > > > On Thu, 18 Jan 2024 at 02:48, Patrick Palka wrote: > > > > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > > > Please

Re: [PATCH] libstdc++: Add and to stdc++.h

2024-01-19 Thread Jonathan Wakely
On Fri, 19 Jan 2024 at 15:16, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. This was on my TODO list after somebody asked about on IRC this week, so thanks for doing it. > > -- >8 -- > > libstdc++-v3/ChangeLog: > > * include/precompiled/stdc+

[committed] libstdc++: Fix P2255R2 dangling checks for std::tuple in C++17 [PR108822]

2024-01-19 Thread Jonathan Wakely
Tested powerp64le-linux. Pushed to trunk. -- >8 -- I accidentally used && in a fold-expression instead of || which meant that in C++17 the tuple(UElements&&...) constructor only failed its debug assertion if all tuple elements were dangling references. Some missing tests (noted as "TODO") meant t

[committed] libstdc++: Do not use CTAD for _Utf32_view alias template (redux)

2024-01-19 Thread Jonathan Wakely
Tested powerp64le-linux. Pushed to trunk. -- >8 -- My change in r14-8181-g665a3ff1539ce2 was incomplete as there's a second place using CTAD with the _Utf32_view alias template. This fixes it. libstdc++-v3/ChangeLog: * include/std/format (_Spec::_M_parse_fill_and_align): Do not

Re: [PATCH] libstdc++: suppress -Wdangling-reference with operator| [PR111410]

2024-01-19 Thread Jonathan Wakely
On Sat, 20 Jan 2024, 03:47 Marek Polacek, wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > OK, thanks. The standard ranges have their own protection against dangling via the opt-in borrowed_range concept, and algorithms that don't allow returning iterators into rvalue ran

[committed] libstdc++: Fix std::format floating-point alternate forms [PR113512]

2024-01-21 Thread Jonathan Wakely
Tested aarch64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- The logic for handling '#' forms was ... not good. The count of significant figures just counted digits, instead of ignoring leading zeros. And when moving the result from the stack buffer to a dynamic string the expone

[committed] libstdc++: Fix std::chrono::file_clock conversions for low-precision times

2024-01-21 Thread Jonathan Wakely
Tested aarch64-linux. Pushed to trunk. Backport needed to gcc-13 too. -- >8 -- THe std::chrono::file_clock conversions were not using common_type and so failed to compile when converting anything that should have increased precision after arithmetic with a std::chrono::seconds value. libstdc++-v

[committed] libstdc++: Fix std::format for floating-point chrono::time_point [PR113500]

2024-01-21 Thread Jonathan Wakely
Tested aarch64-linux. Pushed to trunk. Backport to gcc-13 would be good too, I think. -- >8 -- Currently trying to use std::format with certain specializations of std::chrono::time_point is ill-formed, due to one member function of the __formatter_chrono type which tries to write a time_point to

Re: [committed] libstdc++: Fix std::format for floating-point chrono::time_point [PR113500]

2024-01-22 Thread Jonathan Wakely
On Sun, 21 Jan 2024 at 22:27, Jonathan Wakely wrote: > --- a/libstdc++-v3/testsuite/std/time/clock/file/io.cc > +++ b/libstdc++-v3/testsuite/std/time/clock/file/io.cc > @@ -17,6 +17,23 @@ test_ostream() >VERIFY( ss1.str() == ss2.str() ); > } > > +void > +test_

Re: [committed] libstdc++: Fix std::format for floating-point chrono::time_point [PR113500]

2024-01-22 Thread Jonathan Wakely
On Mon, 22 Jan 2024 at 09:51, Jonathan Wakely wrote: > > On Sun, 21 Jan 2024 at 22:27, Jonathan Wakely wrote: > > --- a/libstdc++-v3/testsuite/std/time/clock/file/io.cc > > +++ b/libstdc++-v3/testsuite/std/time/clock/file/io.cc > > @@ -17,6 +17,23 @@ test_ostream() > &g

Re: [PATCH 1/2] libstdc++/pair: Define _S_const_assignable helper for C++20

2024-01-23 Thread Jonathan Wakely
On Tue, 23 Jan 2024, 23:53 Patrick Palka, wrote: > This is consistent with std::tuple's __const_assignable member function, > and will be reused when implementing the new pair::operator= overloads > from P2165R4. > OK > libstdc++-v3/ChangeLog: > > * include/bits/stl_pair.h (pair::_S_

Re: [PATCH] [testsuite] Fix pretty printers regexps for GDB output

2024-01-24 Thread Jonathan Wakely
On Wed, 24 Jan 2024 at 10:48, Christophe Lyon wrote: > > GDB emits end of lines as \r\n, we currently match the reverse \n\r, We currently match [\n\r]+ which should match any of \n, \r, \n\r or \r\n > possibly leading to mismatches under racy conditions. What do we incorrectly match? Is the pr

Re: [PATCH 2/2] libstdc++: Implement P2165R4 changes to std::pair/tuple/etc

2024-01-24 Thread Jonathan Wakely
On Tue, 23 Jan 2024 at 23:54, Patrick Palka wrote: > diff --git a/libstdc++-v3/include/bits/stl_pair.h > b/libstdc++-v3/include/bits/stl_pair.h > index b81b479ad43..a9b20fbe7ca 100644 > --- a/libstdc++-v3/include/bits/stl_pair.h > +++ b/libstdc++-v3/include/bits/stl_pair.h > @@ -85,12 +85,70 @@ _G

Re: [PATCH 2/2] libstdc++: Implement P2165R4 changes to std::pair/tuple/etc

2024-01-24 Thread Jonathan Wakely
On Wed, 24 Jan 2024 at 12:01, Jonathan Wakely wrote: > > On Tue, 23 Jan 2024 at 23:54, Patrick Palka wrote: > > diff --git a/libstdc++-v3/include/bits/stl_pair.h > > b/libstdc++-v3/include/bits/stl_pair.h > > index b81b479ad43..a9b20fbe7ca 100644 > > --- a/libstd

Re: [PATCH 2/2] libstdc++: Implement P2165R4 changes to std::pair/tuple/etc

2024-01-24 Thread Jonathan Wakely
On Wed, 24 Jan 2024 at 15:24, Patrick Palka wrote: > > On Wed, 24 Jan 2024, Jonathan Wakely wrote: > > > On Tue, 23 Jan 2024 at 23:54, Patrick Palka wrote: > > > diff --git a/libstdc++-v3/include/bits/stl_pair.h > > > b/libstdc++-v3/include/bits/stl_pair.h >

Re: [PATCH 2/2] libstdc++: Implement P2165R4 changes to std::pair/tuple/etc

2024-01-24 Thread Jonathan Wakely
On Wed, 24 Jan 2024 at 17:27, Jonathan Wakely wrote: > > On Wed, 24 Jan 2024 at 15:24, Patrick Palka wrote: > > > > On Wed, 24 Jan 2024, Jonathan Wakely wrote: > > > > > On Tue, 23 Jan 2024 at 23:54, Patrick Palka wrote: > > > > @@ -1016,10

Re: _GLIBCXX_DEBUG_BACKTRACE broken

2024-01-29 Thread Jonathan Wakely
Link against libstdc++exp.a to use > _GLIBCXX_DEBUG_BACKTRACE macro. > > Ok to commit ? Yes please - thanks. > > François > > On 29/01/2024 11:10, Jonathan Wakely wrote: > > On Mon, 29 Jan 2024 at 06:13, François Dumont wrote: > >> Hi > >> &

[PATCH] libstdc++: Enable std::text_encoding for darwin and FreeBSD

2024-01-30 Thread Jonathan Wakely
This should fix the std/text_encoding/* FAILs that Iain sees on darwin. I assume it will make it work for FreeBSD too. I won't push this until I hear it works for at least one of those. Tested x86_64-linux. -- >8 -- The header is needed for newlocale and locale_t on these targets. libstdc++-

[PATCH] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
OK for trunk? -- >8 -- The mklog.py output for libstdc++-v3/include/bits/version.h is awful. Teaching mklog.py that it's generated makes it correctly use "Regenerate" for its changes. We can do the same for the other new generated headers as well. contrib/ChangeLog: * mklog.py (libstdcx

Re: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-01-30 Thread Jonathan Wakely
On 28/09/23 18:37 +0200, Dimitry Andric wrote: Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632 When building gcc's C++ sources against recent libc++, the poisoning of the ctype macros due to including safe-ctype.h before including C++ standard headers such as , , etc, causes many compil

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add n

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add n

Re: [PATCH] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
On Tue, 30 Jan 2024, 15:03 Jonathan Wakely, wrote: > OK for trunk? > > -- >8 -- > > The mklog.py output for libstdc++-v3/include/bits/version.h is awful. > Teaching mklog.py that it's generated makes it correctly use > "Regenerate" for its change

[PATCH v2] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
On 30/01/24 15:02 +, Jonathan Wakely wrote: That way other subdirectories could add their own extra generated files to it. Like so. mklog: Add lookup for generated files in specific sub-directories The mklog.py output for libstdc++-v3/include/bits/version.h is awful

[committed] libstdc++: Fix -Wshift-count-overflow warning in std::bitset

2024-01-31 Thread Jonathan Wakely
Tested x86_64-linux and aarch64-linux. Pushed to trunk. -- >8 -- This shift only happens if the unsigned long long type is wider than unsigned long but the compiler warns when it sees the shift, without caring if it's reachable. Use the preprocessor to compare the sizes and just reuse _M_to_ulon

[committed] libstdc++: Add all supported headers to lists in the manual

2024-01-31 Thread Jonathan Wakely
Another piece of the manual that needs to be kept up to date as we add features. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/using.xml: Update tables of supported headers. * doc/html/*: Regenerate. --- libstdc++-v3/doc/html/manual/index.html | 2 +

[committed] libstdc++: Add "ASCII" as an alias for std::text_encoding::id::ASCII

2024-01-31 Thread Jonathan Wakely
SG16 (Unicode and Text Study Group) and LWG are overwhelmingly in favour of adding this alias, so let's not wait for the issue to get voted into the working draft. Tested aarch64-linux. Pushed to trunk. -- >8 -- As noted in LWG 4043, "ASCII" is not an alias for any known registered character enc

Re: [PATCH] libstdc++: Enable std::text_encoding for darwin and FreeBSD

2024-01-31 Thread Jonathan Wakely
On Wed, 31 Jan 2024 at 09:38, Iain Sandoe wrote: > > Hi Jonathan, > > > On 30 Jan 2024, at 15:02, Jonathan Wakely wrote: > > > > This should fix the std/text_encoding/* FAILs that Iain sees on darwin. > > I assume it will make it work for FreeBSD too. > >

[committed] libstdc++: Fix regression in std::format output of %Y for negative years

2023-12-13 Thread Jonathan Wakely
It seems that what I pushed didn't match what I tested, due to testing on a different machine! Tested x86_64-linux, on the right machine this time. Pushed to trunk. -- >8 -- The change in r14-6468-ga01462ae8bafa8 was only supposed to apply to %C formats, not %Y. libstdc++-v3/ChangeLog:

Re: [r14-6468 Regression] FAIL: std/time/year/io.cc -std=gnu++26 execution test on Linux/x86_64

2023-12-13 Thread Jonathan Wakely
On Wed, 13 Dec 2023 at 10:51, haochen.jiang wrote: > > On Linux/x86_64, > > a01462ae8bafa86e7df47a252917ba6899d587cf is the first bad commit > commit a01462ae8bafa86e7df47a252917ba6899d587cf > Author: Jonathan Wakely > Date: Mon Dec 11 15:33:59 2023 + > >

[PATCH] libstdc++: Optimize std::is_trivially_destructible_v

2023-12-13 Thread Jonathan Wakely
Tested x86_64-linux. Does this look right? Can we do it faster, or simplify it? -- >8 -- This reduces the overhead of using std::is_trivially_destructible_v and as a result fixes some recent regressions seen with a non-default GLIBCXX_TESTSUITE_STDS env var: FAIL: 20_util/variant/87619.cc -std=

Re: [PATCH] libstdc++: Make __gnu_debug::vector usable in constant expressions [PR109536]

2023-12-14 Thread Jonathan Wakely
On Wed, 6 Dec 2023 at 14:30, Jonathan Wakely wrote: > > Any comments on this approach? Pushed to trunk now. > > -- >8 -- > > This makes constexpr std::vector (mostly) work in Debug Mode. All safe > iterator instrumentation and checking is disabled during constant

[committed] libstdc++: Add dg-output to two tests

2023-12-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- These tests are expected to run interactively, with the output checked by eye. Nobody ever does that, but we can at least use dg-output to check that the output is as expected. libstdc++-v3/ChangeLog: * testsuite/27_io/objects/char/2.cc: Us

[committed] libstdc++: Fix %S format of duration with floating-point rep

2023-12-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backport needed too. -- >8 -- I got the order of arguments to std::format_to wrong. It was in a discarded statement, for a case which wasn't being tested. libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (__formatter_chrono::_M_S): Fix order

[committed] libstdc++: Tweaks for std::format fast path

2023-12-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- Fix an incorrect call to _Sink::_M_reserve() which should have passed the __n parameter. This was not actually a problem because it was in an discarded statement, because only the _Seq_sink> specialization was used. Also add some branch prediction h

[committed] libstdc++: Fix filebuf::native_handle() for Windows

2023-12-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES): Add missing header to configure test. Check correct variable. * config/io/basic_file_stdio.cc (__basic_file::native_handle): Fix typo.

[committed] libstdc++: Implement C++23 header [PR107760]

2023-12-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- This adds the C++23 std::print functions, which use std::format to write to a FILE stream or std::ostream (defaulting to stdout). The new extern symbols are in the libstdc++exp.a archive, so we aren't committing to stable symbols in the DSO yet. The

Re: [committed] libstdc++: Implement C++23 header [PR107760]

2023-12-15 Thread Jonathan Wakely
On Fri, 15 Dec 2023 at 01:17, Tim Song wrote: > > On Thu, Dec 14, 2023 at 6:05 PM Jonathan Wakely wrote: >> + inline void >> + vprint_unicode(ostream& __os, string_view __fmt, format_args __args) >> + { >> +ostream::sentry __cerb(__os); >> +if (_

[committed] libstdc++: Do not add padding for std::print to std::ostream

2023-12-15 Thread Jonathan Wakely
Tested x86_64-linux and x86_64-w64-mingw. Pushed to trunk. -- >8 -- Tim Song pointed out that although std::print behaves as a formatted output function, it does "determine padding" using the stream's flags. libstdc++-v3/ChangeLog: * include/std/ostream (vprint_nonunicode, vprint_unicod

[committed] libstdc++: Simplify std::vprint_unicode for non-Windows targets

2023-12-15 Thread Jonathan Wakely
Tested x86_64-linux and x86_64-w64-mingw. Pushed to trunk. -- >8 -- Since we don't need to do anything special to print Unicode on non-Windows targets, we might as well just use std::vprint_nonunicode to implement std::vprint_unicode. Removing the duplicated code should reduce code size in cases

[committed] libstdc++: Fix std::print test case for Windows

2023-12-15 Thread Jonathan Wakely
Tested x86_64-linux and x86_64-w64-mingw. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * src/c++23/print.cc (__write_to_terminal) [_WIN32]: If handle does not refer to the console then just write to it using normal file I/O. * testsuite/27_io/print/2.cc (as_p

Re: [committed] libstdc++: Implement C++23 header [PR107760]

2023-12-16 Thread Jonathan Wakely
On Fri, 15 Dec 2023 at 14:49, Tim Song wrote: > > > > On Fri, Dec 15, 2023 at 4:43 AM Jonathan Wakely wrote: >> >> On Fri, 15 Dec 2023 at 01:17, Tim Song wrote: >> > >> > On Thu, Dec 14, 2023 at 6:05 PM Jonathan Wakely wrote: >> >>

Re: [PATCH] libstdc++: Make __gnu_debug::vector usable in constant expressions [PR109536]

2023-12-16 Thread Jonathan Wakely
On Sat, 16 Dec 2023 at 00:27, Patrick Palka wrote: > > On Wed, 6 Dec 2023, Jonathan Wakely wrote: > > > Any comments on this approach? > > > > -- >8 -- > > > > This makes constexpr std::vector (mostly) work in Debug Mode. All safe > > iterator

Re: [PATCH] libstdc++: Make __gnu_debug::vector usable in constant expressions [PR109536]

2023-12-16 Thread Jonathan Wakely
On Sat, 16 Dec 2023 at 09:14, Jonathan Wakely wrote: > > On Sat, 16 Dec 2023 at 00:27, Patrick Palka wrote: > > > > On Wed, 6 Dec 2023, Jonathan Wakely wrote: > > > > > Any comments on this approach? > > > > > > -- >8 -- > > > > >

Re: [PATCH] libstdc++: Make __gnu_debug::vector usable in constant expressions [PR109536]

2023-12-16 Thread Jonathan Wakely
On Sat, 16 Dec 2023 at 16:26, Patrick Palka wrote: > > On Sat, 16 Dec 2023, Jonathan Wakely wrote: > > > On Sat, 16 Dec 2023 at 09:14, Jonathan Wakely wrote: > > > > > > On Sat, 16 Dec 2023 at 00:27, Patrick Palka wrote: > > > > >

Re: [PATCH v26 00/23] Optimize type traits compilation performance

2023-12-16 Thread Jonathan Wakely
patches for library folks to apply. I've reviewed all the library patches in v26 and they are all OK for trunk. Please push (or Patrick can do so). Thanks, Ken! Great work, I'm really happy to see this land in GCC trunk. +Reviewed-by: Jonathan Wakely

[wwwdocs] Document std::print and std::ranges::to for C++23

2023-12-16 Thread Jonathan Wakely
Pushed to wwwdocs. -- >8 -- --- htdocs/gcc-14/changes.html | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 346785a0..eb14e09d 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@

[wwwdocs] Update notes on libstdc++ header dependency changes in GCC 14

2023-12-16 Thread Jonathan Wakely
Pushed to wwwdocs. -- >8 -- --- htdocs/gcc-14/porting_to.html | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-14/porting_to.html b/htdocs/gcc-14/porting_to.html index dea9ac80..3e4cedc3 100644 --- a/htdocs/gcc-14/porting_to.html +++ b/htdocs/gcc-14/porting_to.

Re: [committed] libstdc++: Implement C++23 header [PR107760]

2023-12-16 Thread Jonathan Wakely
On Sat, 16 Dec 2023 at 23:06, David Edelsohn wrote: > > On Sat, Dec 16, 2023 at 4:44 PM Jakub Jelinek wrote: >> >> On Sat, Dec 16, 2023 at 04:24:13PM -0500, David Edelsohn wrote: >> > AIX stdio.h defines fileno as a macro although there is a symbol in libc. >> > >> > I think that print.cc at leas

[committed] libstdc++: Fix bootstrap on AIX due to fileno macro

2023-12-16 Thread Jonathan Wakely
Tested x86_64-linux (and built on AIX). Pushed to trunk. -- >8 -- On AIX fileno is a function-like macro, so enclose the name in parentheses to ensure we use the real function. libstdc++-v3/ChangeLog: * src/c++23/print.cc (__open_terminal(FILE*)): Avoid fileno macro. --- libstd

Re: [committed] libstdc++: Implement C++23 header [PR107760]

2023-12-16 Thread Jonathan Wakely
On Sun, 17 Dec 2023 at 00:02, Jonathan Wakely wrote: > > On Sat, 16 Dec 2023 at 23:06, David Edelsohn wrote: > > > > On Sat, Dec 16, 2023 at 4:44 PM Jakub Jelinek wrote: > >> > >> On Sat, Dec 16, 2023 at 04:24:13PM -0500, David Edelsohn wrote: > >

Re: [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_*

2023-12-17 Thread Jonathan Wakely
On Sun, 17 Dec 2023 at 15:38, Florian Weimer wrote: > > This matches other compiler diagnostics. No test updates are needed > because c-c++-common/pr95378.c does not match a specific -W option. > > Fixes commit d2384b7b24f8557b66f6958a05ea99ff4307e75c ("c-family: > check qualifiers of arguments t

Re: [PATCH v2 1/2] libstdc++: add missing include in ranges_util.h

2023-12-21 Thread Jonathan Wakely
On Thu, 21 Dec 2023 at 21:26, Arsen Arsenović wrote: > > libstdc++-v3/ChangeLog: > > * include/bits/ranges_util.h: Add missing > include. OK > --- > libstdc++-v3/include/bits/ranges_util.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libstdc++-v3/include/bits/ranges

Re: [PATCH v2 2/2] libstdc++: implement std::generator

2023-12-21 Thread Jonathan Wakely
On Thu, 21 Dec 2023 at 21:26, Arsen Arsenović wrote: > > libstdc++-v3/ChangeLog: > > * include/Makefile.am: Install std/generator, bits/elements_of.h > as freestanding. > * include/Makefile.in: Regenerate. > * include/bits/version.def: Add __cpp_lib_generator. >

Re: [PATCH 5/5][_Hashtable] Prefer to insert after last node

2023-12-21 Thread Jonathan Wakely
I think this should wait for the next stage 1. It's a big patch affecting the default -std mode (not just experimental C++20/23/26 material), and was first posted after the end of stage 1. Do we really need the changes for versioned namespace? How much difference does that extra member make to per

Re: [PATCH 1/5][_Hashtable] Add benches

2023-12-21 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 21:58, François Dumont wrote: > > libstdc++: [_Hashtable] Enhance/Add performance benches This one is OK for trunk now, thanks.

Re: [PATCH 2/5][_Hashtable] Fix implementation inconsistencies

2023-12-21 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 21:59, François Dumont wrote: > > libstdc++: [_Hashtable] Fix some implementation inconsistencies > > Get rid of the different usages of the mutable keyword. For > _Prime_rehash_policy methods are exported from the library, we need to > keep their const q

Re: [PATCH 3/5][_Hashtable] Avoid redundant usage of rehash policy

2023-12-21 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 21:59, François Dumont wrote: > > libstdc++: [_Hashtable] Avoid redundant usage of rehash policy > > Bypass call to __detail::__distance_fwd and the check if rehash is > needed when > assigning an initializer_list to an unordered_multimap or > unordered_multis

Re: [PATCH 4/5][_Hashtable] Generalize the small size optimization

2023-12-21 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 22:00, François Dumont wrote: > > libstdc++: [_Hashtable] Extend the small size optimization > > A number of methods were still not using the small size > optimization which > is to prefer an O(N) research to a hash computation as long as N is > small. > >

Re: [PATCH] libstdc++ testsuite/20_util/hash/quality.cc: Increase timeout 3x

2023-12-30 Thread Jonathan Wakely
On Sat, 30 Dec 2023, 01:24 Hans-Peter Nilsson, wrote: > Tested for mmix and observing the increased timeout in the .log > file - and the test passing. > > Ok to commit? Or better suggestions? > OK to commit, thanks. > -- >8 -- > Testing for mmix (a 64-bit target using Knuth's simulator). Th

Re: [PATCH] libstdc++ testsuite/std/ranges/iota/max_size_type.cc: Reduce /10 for simulators

2023-12-30 Thread Jonathan Wakely
On Sat, 30 Dec 2023, 01:41 Hans-Peter Nilsson, wrote: > I'm not completely sure I got the intent of the "log2_limit", > or whether "limit" is sane to decrease like this; it just > looked like an obvious and safe reduction. Also, I verified > the 10+ minute runtime, on this same host (clocked at

Re: [PATCH] libstdc++: testsuite: reduce max_size_type.cc exec time [PR113175]

2024-01-02 Thread Jonathan Wakely
On Tue, 2 Jan 2024, 17:49 Patrick Palka, wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk and release > branches (r14-205 was backported everywhere)? > Yes, thanks. > -- >8 -- > > The adjustment to max_size_type.cc in r14-205-g83470a5cd4c3d2 > inadvertently increased the ex

Re: [PATCH v2 2/2] libstdc++: implement std::generator

2024-01-04 Thread Jonathan Wakely
On Thu, 21 Dec 2023 at 21:26, Arsen Arsenović wrote: > + > +template > +concept _Stateless_alloc = (allocator_traits<_A>::is_always_equal::value > + && default_initializable<_A>); The _A here is a BADNAME and needs to be more than one letter. FAIL: 17_intro/b

Re: [PATCH v2 2/2] libstdc++: implement std::generator

2024-01-04 Thread Jonathan Wakely
On Thu, 4 Jan 2024 at 12:01, Arsen Arsenović wrote: > > > Jonathan Wakely writes: > > > On Thu, 21 Dec 2023 at 21:26, Arsen Arsenović wrote: > >> + > >> +template > >> +concept _Stateless_alloc = >

[PATCH] contrib: Add script name to usage error in gen_wcwidth.py

2024-01-04 Thread Jonathan Wakely
I intend to commit this as obvious later today. -- >8 -- contrib/ChangeLog: * unicode/gen_wcwidth.py: Add sys.argv[0] to usage error. --- contrib/unicode/gen_wcwidth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/unicode/gen_wcwidth.py b/contrib/unicode/g

[PATCH] contrib: Remove C-style comments from Python files

2024-01-04 Thread Jonathan Wakely
I plan to push this as obvious. There are also 32 other files that match "^# .*licenses/>\. *\*/$" in the repo, mostly .exp files in the testsuite. I'm not changing them, only the Python files under contrib. -- >8 -- These Python scripts have "*/" at the end of the license header comment blocks,

Re: [PATCH v2] libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT

2024-01-04 Thread Jonathan Wakely
n traits in the type_traits header through > _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS macro, without needing to modify the > source code. OK for trunk, thanks. +Reviewed-by: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/std/type_traits: Use _GLIBCXX_USE_BUIL

Re: [PATCH v2 6/8] libstdc++: Optimize std::is_pointer compilation performance

2024-01-04 Thread Jonathan Wakely
gt; __is_pointer built-in trait. Optimize its implementation. > * include/std/type_traits (is_pointer): Likewise. > (is_pointer_v): Likewise. > > Co-authored-by: Jonathan Wakely > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/bits/cpp_type_traits.

[committed] libstdc++: Use if-constexpr in std::__try_use_facet [PR113099]

2024-01-05 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- As noted in the PR, we can use if-constexpr for the explicit instantantiation definitions that are compiled with -std=gnu++11. We just need to disable the -Wc++17-extensions diagnostics. libstdc++-v3/ChangeLog: PR libstdc++/113099 *

[committed] libstdc++: Remove UB from month and weekday additions and subtractions.

2024-01-05 Thread Jonathan Wakely
From: Cassio Neri Tested x86_64-linux. Pushed to trunk. This seems suitable for backporting too, at least to gcc-13. -- >8 -- The following invoke signed integer overflow (UB) [1]: month + months{MAX} // where MAX is the maximum value of months::rep month + months{MIN} // where MIN is

[committed] libstdc++: Fix std::char_traits::move [PR113200]

2024-01-05 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed too. -- >8 -- The current constexpr implementation of std::char_traits::move relies on being able to compare the pointer parameters, which is not allowed for unrelated pointers. We can use __builtin_constant_p to determine whether it's safe t

Re: Patch: Remove unneeded double operation in libstdc++-v3/src/c++17/fs_path.cc

2024-01-05 Thread Jonathan Wakely
On 18/12/23 09:36 +0100, Martin Küttler wrote: This is a small change to libstdc++ which does not change any behavior. Please CC the libstd...@gcc.gnu.org list on all libstdc++ patches, as documented at https://gcc.gnu.org/lists.html Otherwise I won't see the patches unless I happen to glance

Re: Patch: Remove unneeded double operation in libstdc++-v3/src/c++17/fs_path.cc

2024-01-05 Thread Jonathan Wakely
On Fri, 5 Jan 2024 at 13:00, Martin Küttler wrote: > > > >>This is a small change to libstdc++ which does not change any behavior. > > > > Please CC the libstd...@gcc.gnu.org list on all libstdc++ patches, as > > documented at https://gcc.gnu.org/lists.html > > Acknowledged. Sorry. > > >>This chan

<    2   3   4   5   6   7   8   9   10   11   >