[committed] libstdc++: Do not use deduced return type for std::visit [PR 100384]

2021-05-04 Thread Jonathan Wakely via Gcc-patches
This avoids errors outside the immediate context when std::visit is an overload candidate because of ADL, but not actually viable. The solution is to give std::visit a non-deduced return type. New helpers are introduced for that, and existing ones refactored slightly. libstdc++-v3/ChangeLog:

Re: ctype support for libstdc++ on VxWorks

2021-05-04 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:53 +0200, François Dumont via Libstdc++ wrote: On 04/05/21 4:52 am, Alexandre Oliva wrote: This patch adds ctype and locale support to libstdc++ on vxworks7. We've been using this for a while internally. It was tested with various vx7r2 targets. Ok to install? From: Corentin G

[committed 1/4] libstdc++ Fix undefined behaviour in testsuite

2021-05-04 Thread Jonathan Wakely via Gcc-patches
Fix some test bugs found by ubsan. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/3.cc: Use unsigned type to avoid overflow. * testsuite/24_iterators/reverse_iterator/2.cc: Do not add non-zero value to null pointer. * testsuite/25_algorithms/copy_ba

[committed 2/4] libstdc++: Fix null dereference in pb_ds containers

2021-05-04 Thread Jonathan Wakely via Gcc-patches
This fixes ubsan errors: ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp:533:15: runtime error: member access within null pointer of type 'struct entry' libstdc++-v3/ChangeLog: * include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp (find_key_pointer(key_const_reference

[committed 3/4] libstdc++: Fix undefined behaviour in std::string

2021-05-04 Thread Jonathan Wakely via Gcc-patches
This fixes a ubsan error when constructing a string with a null pointer: bits/basic_string.h:534:21: runtime error: applying non-zero offset 18446744073709551615 to null pointer The _M_construct function only cares whether the second pointer is non-null, so create a non-null value without undef

[committed 4/4] libstdc++: Fix null dereferences in std::promise

2021-05-04 Thread Jonathan Wakely via Gcc-patches
This fixes some ubsan errors in std::promise: future:1153:34: runtime error: member call on null pointer of type 'struct element_type' future:1153:34: runtime error: member access within null pointer of type 'struct element_type' The problem is that the check for a null pointer is done inside

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: This rewrites ranges::minmax and ranges::minmax_element so that it performs at most 3*N/2 many comparisons, as required by the standard. In passing, this also fixes PR100387 by avoiding a premature std::move in ranges::minmax and in std:

Re: [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: These constraints are already present on the template we're partially specilalizing for. [ This was recently fixed editorially in https://github.com/cplusplus/draft/pull/4519 ] Tested on x86_64-pc-linux-gnu, does this look OK for trunk

Re: [PATCH] libstdc++: Implement LWG 3517 and 3520 for transform_view/join_view

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 10/11? Yes, for all branches. libstdc++-v3/ChangeLog: * include/std/ranges (transform_view::_Iterator::iter_swap): Remove as per LWG 3520.

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 10:39 +0100, Jonathan Wakely wrote: On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: This rewrites ranges::minmax and ranges::minmax_element so that it performs at most 3*N/2 many comparisons, as required by the standard. In passing, this also fixes PR100387 by avoiding a

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 08:03 +0200, François Dumont wrote: On 03/05/21 11:06 pm, Jonathan Wakely wrote: On 03/05/21 22:17 +0200, François Dumont via Libstdc++ wrote: Is it too early to consider this patch ? Or just lack of time ? I haven't had time to review it yet, but my general feeling hasn't changed

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 24/04/21 15:46 +0200, François Dumont via Libstdc++ wrote: Hi     Here is the patch to add backtrace generation on _GLIBCXX_DEBUG assertions thanks to libbacktrace.     In addition to this integration I am also improving the generation of the assertion message thanks to the "%.*s" printf

[committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-05 Thread Jonathan Wakely via Gcc-patches
Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char to std::isdigit. Tested powerpc64le-linux. Committed to trunk. commit d0d6ca019717305df0ef41e3fe1da48f7f561fac Author: Jon

[committed] libstdc++: Add tests for std::invoke feature test macro

2021-05-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/function_objects/invoke/3.cc: Check feature test macro. * testsuite/20_util/function_objects/invoke/version.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit 29745bf06276b9628d08ef1c9e28890cc56df4aa Author: Jona

Re: [committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 21:57 +0200, François Dumont via Libstdc++ wrote: On 05/05/21 2:01 pm, Jonathan Wakely via Libstdc++ wrote: Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char t

Re: [PATCH 1/2] libstdc++: Implement LWG 3391 changes to move/counted_iterator::base

2021-05-06 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 16:23 -0400, Patrick Palka via Libstdc++ wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk/10/11? Yes, thanks. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (move_iterator::base): Make the const& overload return a const reference and remove

Re: [PATCH 2/2] libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()

2021-05-06 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 16:23 -0400, Patrick Palka via Libstdc++ wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk/10/11? Yes, thanks. libstdc++-v3/ChangeLog: * include/std/ranges (filter_view::_Iterator::base): Make the const& overload return a const reference and remove

[committed] libstdc++: Fix definition of std::remove_cvref_t

2021-05-06 Thread Jonathan Wakely via Gcc-patches
I originally defined std::remove_cvref_t in terms of the internal __remove_cvref_t trait, to avoid instantiating the remove_cvref class template. However, as described in P1715R0 that is observable by users and is thus non-conforming. This defines remove_cvref_t as specified in the standard. libs

Re: [committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-06 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 22:14 +0100, Jonathan Wakely wrote: On 05/05/21 21:57 +0200, François Dumont via Libstdc++ wrote: On 05/05/21 2:01 pm, Jonathan Wakely via Libstdc++ wrote: Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (

Re: [Patch, fortran] PRs 46691 and 99819: Assumed and explicit size class arrays

2021-05-06 Thread Jonathan Wakely via Gcc-patches
PR 46691 is the wrong PR number: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46691 The comment in the testcase is wrong, and the ChangeLog file will get auto-updated with the wrong number overnight (you can manually edit it and push the fix tomorrow after it's been generated).

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-07 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 12:33 +0100, Jonathan Wakely wrote: On 24/04/21 15:46 +0200, François Dumont via Libstdc++ wrote: Hi     Here is the patch to add backtrace generation on _GLIBCXX_DEBUG assertions thanks to libbacktrace. Ville pointed out that we'll need to use libbacktrace for std::stacktrace

Re: [committed] libstdc++: Implement LWG 1203 for rvalue iostreams

2021-05-07 Thread Jonathan Wakely via Gcc-patches
On 06/05/21 18:28 +0100, Jonathan Wakely wrote: On 06/05/21 18:09 +0100, Jonathan Wakely wrote: On 06/05/21 17:55 +0200, Stephan Bergmann wrote: On 30/04/2021 15:48, Jonathan Wakely via Libstdc++ wrote: This implements the resolution of LWG 1203 so that the constraints for rvalue stream insert

[committed] libstdc++: Rename test type to avoid clashing with std::any

2021-05-10 Thread Jonathan Wakely via Gcc-patches
When PCH are enabled this test file includes and so the using-directive brings std::any into the global scope. It isn't currently a problem, because the -std option in the dg-options means that PCH is not used. If that option is removed, the test fails with PCH and passes without. This just renam

[committed] libstdc++: Adjust expected errors in tests when compiled as C++20

2021-05-10 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/scoped_allocator/69293_neg.cc: Add dg-error for additional errors in C++20. * testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc: Likewise. * testsuite/20_util/uses_allocator/69293_neg

[committed 1/9] libstdc++: Remove redundant -std=gnu++17 options from PSTL tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 646e6c652448bfd8fca535d91f588b4606295a72 Author: Jonathan Wakely

[committed 2/9] libstdc++: Remove redundant -std=gnu++17 options from filesystem tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit aa60ff1c8879f67557efc188b1d18d008458c76a Author: Jonathan Wakel

[committed 3/9] libstdc++: Remove redundant -std=gnu++17 options from any/optional/variant tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 8240175b87e331c87993876e782971eda46f9a6e Author: Jonathan Wakely

[committed 4/9] libstdc++: Remove redundant -std=gnu++17 options from concurrency tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 9cd88c022fcad783997cd4111b2e6c3700c4b15b Author: Jonathan Wakel

[committed 5/9] libstdc++: Remove redundant -std=gnu++17 options from PMR tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 7a4e52e44a8c9e6c59060adc691de5144d3c6940 Author: Jonathan Wakely

[committed 6/9] libstdc++: Remove redundant -std=gnu++17 options from strings tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 8087e70267ce6fa0787152963339ba987e7b514d Author: Jonathan Wakely

[committed 7/9] libstdc++: Remove redundant -std=gnu++17 options from containers tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk.

[committed 8/9] libstdc++: Remove redundant -std=gnu++17 options from algorithm tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit d7b2d92747f8d236050af3ec5741786f0f878716 Author: Jonathan Wakel

[committed 9/9] libstdc++: Remove redundant -std=gnu++17 options from remaining tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. commit 0498d2d09a2364aae1e6b5e085c8ebb8fc517684 Author: Jonathan Wakely

Re: [committed 7/9] libstdc++: Remove redundant -std=gnu++17 options from containers tests

2021-05-10 Thread Jonathan Wakely via Gcc-patches
On 10/05/21 16:29 +0100, Jonathan Wakely wrote: GCC defaults to -std=gnu++17 now anyway, and using it explicitly in the dg-options directive prevents running these tests with different modes such as -std=c++17 or -std=gnu++20. Tested powerpc64le-linux. Committed to trunk. With the patch attach

Re: [PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-10 Thread Jonathan Wakely via Gcc-patches
On 03/05/21 09:43 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This should also be backported to gcc-11 The additional _M_laundered data member changes the object layout. That isn't safe for the branch. Would it be possible to smuggle that flag in the least significant bit of the _M_addr

[committed] libstdc++: Implement proposed resolution to LWG 3548

2021-05-10 Thread Jonathan Wakely via Gcc-patches
This has been tentatively approved by LWG. The deleter from a unique_ptr can be moved into the shared_ptr (at least, since LWG 2802). This uses std::forward<_Del>(__r.get_deleter()) not std::move(__r.get_deleter()) because we don't want to convert the deleter to an rvalue when _Del is an lvalue ref

[committed] libstdc++: Remove TODO comment

2021-05-10 Thread Jonathan Wakely via Gcc-patches
We have a comment saying to replace the simple binary_semaphore type with std::binary_semaphore, which has been done. However, that isn't defined on all targets. So keep the simple one here that just implements the parts of the API needed by , and remove the comment suggesting it should be replaced

[committed] libstdc++: Fix missing members in std::allocator

2021-05-11 Thread Jonathan Wakely via Gcc-patches
The changes in 75c6a925dab5b7af9ab47c10906cb0e140261cc2 were slightly incorrect, because the converting constructor should be noexcept, and the POCMA and is_always_equal traits should still be present in C++20. This fixes it, and slightly refactors the preprocessor conditions and order of members.

[committed] libstdc++: Fix tests that fail in C++98 mode

2021-05-11 Thread Jonathan Wakely via Gcc-patches
The header synopsis test fails to define NOTHROW for C++98. The shared_ptr test should be skipped for C++98. The debug mode one should work for C++98 too, it just needs to avoid C++11 syntax that isn't valid in C++98. libstdc++-v3/ChangeLog: * testsuite/20_util/headers/memory/synopsis.c

Re: [PATCH] libstdc++: Remove extern "C" from Ryu sources

2021-05-11 Thread Jonathan Wakely via Gcc-patches
On 11/05/21 11:16 -0400, Patrick Palka via Libstdc++ wrote: On Tue, 11 May 2021, Patrick Palka wrote: floating_to_chars.cc includes the Ryu sources into an anonymous namespace as a convenient way to give all its symbols internal linkage. But an entity declared extern "C" always has external lin

Re: [PATCH] libstdc++: Remove extern "C" from Ryu sources

2021-05-11 Thread Jonathan Wakely via Gcc-patches
On 11/05/21 13:04 -0400, Patrick Palka wrote: On Tue, 11 May 2021, Jonathan Wakely wrote: On 11/05/21 11:16 -0400, Patrick Palka via Libstdc++ wrote: > On Tue, 11 May 2021, Patrick Palka wrote: > > > floating_to_chars.cc includes the Ryu sources into an anonymous > > namespace as a convenient w

Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions

2021-05-11 Thread Jonathan Wakely via Gcc-patches
On 11/05/21 21:27 +0300, Antony Polukhin via Libstdc++ wrote: This patch provides compile time diagnostics for common misuse of [locale.convenience] functions with std::string as a character type. 2021-05-11 Antony Polukhin PR libstdc++/89728 * include/bits/locale_facets.h (ctype) Add stat

Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions

2021-05-12 Thread Jonathan Wakely via Gcc-patches
On 11/05/21 21:00 +0100, Jonathan Wakely wrote: Alternatively, would it be even simpler to just define a partial specialization of ctype? template class ctype > { #if __cplusplus >= 201103L static_assert(something dependent, "std::basic_string used as a character type"

[committed] libstdc++: Fix some problems in PSTL tests

2021-05-12 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc: Increase dg-timeout-factor to 4. Fix -Wunused-parameter warnings. Replace bitwise AND with logical AND in loop condition. * testsuite/25_algorithms/pstl/alg_nonmodifying/sea

Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions

2021-05-12 Thread Jonathan Wakely via Gcc-patches
On 12/05/21 12:58 +0300, Antony Polukhin wrote: ср, 12 мая 2021 г. в 12:18, Jonathan Wakely : <...> Or just leave it undefined, as libc++ seems to do according to your comment in PR 89728: error: implicit instantiation of undefined template 'std::__1::ctype >' Was your aim to have a static_as

Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions

2021-05-12 Thread Jonathan Wakely via Gcc-patches
On 12/05/21 18:51 +0300, Antony Polukhin via Libstdc++ wrote: ср, 12 мая 2021 г. в 18:38, Antony Polukhin : ср, 12 мая 2021 г. в 17:44, Jonathan Wakely : > > On 12/05/21 12:58 +0300, Antony Polukhin wrote: > >ср, 12 мая 2021 г. в 12:18, Jonathan Wakely : > ><...> > >> Or just leave it undefined

Re: [PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-14 Thread Jonathan Wakely via Gcc-patches
On 13/05/21 18:54 -0700, Thomas Rodgers wrote: From: Thomas Rodgers Please ignore the previous patch. This one removes the need to carry any extra state in the case of a 'laundered' atomic wait. libstdc++/ChangeLog: * include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop un

[committed] libstdc++: Allow lualatex to be used for Doxygen PDF

2021-05-17 Thread Jonathan Wakely via Gcc-patches
This allows the Doxygen PDF to be built using lualatex instead of pdflatex, which solves a problem with pdflatex running out of memory sometimes. This is done by adding a --latex_cmd option to the run_doxygen script, which then sets the specified command in the generated user.cfg file used by Doxyg

[PATCH] c++: Fix diagnostic for binding lvalue reference to volatile rvalue [PR 100635]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
The current diagnostic assumes the reference binding fails because the reference is non-const, but it can also fail if the rvalue is volatile. Use the current diagnostic for non-const cases, and a modified diagnostic otherwise. gcc/cp/ChangeLog: PR c++/100635 * call.c (convert_li

[PATCH] libstdc++: Fix filesystem::path constraints for volatile [PR 100630]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
The constraint check for filesystem::path construction uses decltype(__is_path_src(declval())) which mean it considers conversion from an rvalue. When Source is a volatile-qualified type it cannot use is_path_src(const Unknown&) because a const lvalue reference can only bind to a non-volatile rval

Re: [PATCH] libstdc++: Fix filesystem::path constraints for volatile [PR 100630]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 15:02 +0100, Jonathan Wakely wrote: The constraint check for filesystem::path construction uses decltype(__is_path_src(declval())) which mean it considers conversion from an rvalue. When Source is a volatile-qualified type it cannot use is_path_src(const Unknown&) because a const lva

Re: [PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 14/05/21 18:09 +0100, Jonathan Wakely wrote: On 13/05/21 18:54 -0700, Thomas Rodgers wrote: From: Thomas Rodgers Please ignore the previous patch. This one removes the need to carry any extra state in the case of a 'laundered' atomic wait. libstdc++/ChangeLog: * include/bits/atomic

Re: [PATCH] libstdc++: Fix up semiregular-box partial specialization [PR100475]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 11:43 -0400, Patrick Palka via Libstdc++ wrote: This makes the in-place constructor of our partial specialization of __box for already-semiregular types to use direct-non-list-initialization (in accordance with the specification of the primary template), and additionally makes its dat

Re: [PATCH] libstdc++: Fix condition for memoizing reverse_view::begin() [PR100621]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 12:17 -0400, Patrick Palka via Libstdc++ wrote: A range being a random access range is not a sufficient condition for ranges::next(iter, sent) to have constant time complexity; the range must also have a sized sentinel. This adjusts the memoization condition for reverse_view accordin

Re: [PATCH] libstdc++: Fix access issues in elements_view::_Sentinel [PR100631]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 12:17 -0400, Patrick Palka via Libstdc++ wrote: Tested on x86_64-pc-linux-gnu, does this look OK for 10/11/trunk? OK, thanks. libstdc++-v3/ChangeLog: PR libstdc++/100631 * include/std/ranges (elements_view::_Iterator): Befriend _Sentinel. (elements

Re: [PATCH] libstdc++: Fix iterator caching inside range adaptors [PR100479]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 11:43 -0400, Patrick Palka via Libstdc++ wrote: This fixes two issues with our iterator caching as described in detail in the PR. Since r12-336 added the __non_propagating_cache class template as part of P2328, this patch just rewrites the _CachedPosition partial specialization in te

[committed] libstdc++: Fix std::jthread assertion and re-enable skipped test

2021-05-17 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/thread (jthread::_S_create): Fix static assert message. * testsuite/30_threads/jthread/95989.cc: Re-enable test. * testsuite/30_threads/jthread/jthread.cc: Do not require pthread effective target. * testsuite/30_

Re: [PATCH] libstdc++: Fix filesystem::path constraints for volatile [PR 100630]

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 17/05/21 15:25 +0100, Jonathan Wakely wrote: On 17/05/21 15:02 +0100, Jonathan Wakely wrote: The constraint check for filesystem::path construction uses decltype(__is_path_src(declval())) which mean it considers conversion from an rvalue. When Source is a volatile-qualified type it cannot us

Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 12/05/21 17:16 +0100, Jonathan Wakely wrote: On 12/05/21 18:51 +0300, Antony Polukhin via Libstdc++ wrote: ср, 12 мая 2021 г. в 18:38, Antony Polukhin : ср, 12 мая 2021 г. в 17:44, Jonathan Wakely : On 12/05/21 12:58 +0300, Antony Polukhin wrote: >ср, 12 мая 2021 г. в 12:18, Jonathan Wake

Re: [PATCH] gcc-changelog: Remove non-strict mode.

2021-05-17 Thread Jonathan Wakely via Gcc-patches
On 11/05/21 10:56 +0200, Martin Liška wrote: Hello. I'm going to push a commit that removes non-strict mode. It's useless right now. Martin contrib/ChangeLog: * gcc-changelog/git_check_commit.py: Remove --non-strict-mode. * gcc-changelog/git_commit.py: Remove strict mode.

Re: [PATCH] gcc-changelog: Remove non-strict mode.

2021-05-18 Thread Jonathan Wakely via Gcc-patches
On 18/05/21 09:31 +0200, Martin Liška wrote: On 5/17/21 7:55 PM, Jonathan Wakely wrote: On 11/05/21 10:56 +0200, Martin Liška wrote: Hello. I'm going to push a commit that removes non-strict mode. It's useless right now. Martin contrib/ChangeLog: * gcc-changelog/git_check_commit.py: Rem

Re: [PATCH] libstdc++: Make chrono::hh_mm_ss more compact

2022-12-12 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Dec 2022 at 07:12, Stephan Bergmann via Libstdc++ wrote: > > On 11/21/22 21:43, Jonathan Wakely via Libstdc++ wrote: > > + static constexpr bool __is_unsigned > > + = __and_v, > > + is_unsigned>; > > Using `__is_unsigned` as an identifier here causes compilatio

[committed] libstdc++: Make operator<< for stacktraces less templated (LWG 3515)

2022-12-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8-- This change was approved for C++23 last month. libstdc++-v3/ChangeLog: * include/std/stacktrace (operator<<): Only output to narrow ostreams (LWG 3515). * testsuite/19_diagnostics/stacktrace/synopsis.cc: --- libstdc++-v3/inc

[committed] libstdc++: Define atomic lock-free type aliases for C++20 [PR98034]

2022-12-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8-- libstdc++-v3/ChangeLog: PR libstdc++/98034 * include/std/atomic (__cpp_lib_atomic_lock_free_type_aliases): Define macro. (atomic_signed_lock_free, atomic_unsigned_lock_free): Define aliases. * include/s

[committed] libstdc++: Change names that clash with Win32 or Clang

2022-12-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8-- Clang now defines an __is_unsigned built-in, and Windows defines an _Out_ macro. Replace uses of those as identifiers. There might also be a problem with __is_signed, which we use in several places. libstdc++-v3/ChangeLog: * include/std/chr

[committed] libstdc++: Add a test checking for chrono::duration overflows

2022-12-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8-- This test fails if chrono::days::rep or chrono::years::rep is a 32-bit type, because a large days or years value silently overflows a 32-bit integer when converted to seconds. It would be conforming to implement chrono::days as chrono::duration>, but

[committed] libstdc++: Fix constraint on std::basic_format_string [PR108024]

2022-12-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8-- Also remove some redundant std::move calls for return statements. libstdc++-v3/ChangeLog: PR libstdc++/108024 * include/std/format (basic_format_string): Fix constraint. * testsuite/std/format/format_string.cc: New test. ---

Re: [PATCH] libstdc++: Make chrono::hh_mm_ss more compact

2022-12-12 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Dec 2022 at 11:18, Jonathan Wakely wrote: > > On Mon, 12 Dec 2022 at 07:12, Stephan Bergmann via Libstdc++ > wrote: > > > > On 11/21/22 21:43, Jonathan Wakely via Libstdc++ wrote: > > > + static constexpr bool __is_unsigned > > > + = __and_v, > > > + is_unsigne

Re: [PATCH] libstdc++: Update backtrace-rename.h

2022-12-13 Thread Jonathan Wakely via Gcc-patches
On Tue, 13 Dec 2022 at 09:44, Jakub Jelinek wrote: > > Hi! > > When writing the r13-4629 commit log I've realized that libsanitizer > isn't the only place which nowadays renames libbacktrace symbols, > libstdc++ does that too. > > Ok for trunk if this passes bootstrap/regtest? OK, thanks. When w

Re: [PATCH] c++, libstdc++: Add typeinfo for _Float{16, 32, 64, 128, 32x, 64x} and __bf16 types [PR108075]

2022-12-13 Thread Jonathan Wakely via Gcc-patches
On Tue, 13 Dec 2022 at 09:40, Jakub Jelinek wrote: > > Hi! > > The following patch adds typeinfos for the extended floating point > types and _Float{32,64}x. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? The libstdc++ parts look good, thanks. > 2022-12-13 Jakub Jeline

[committed] libstdc++: Fix size passed to operator delete [PR108097]

2022-12-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The number of elements gets stored in _M_capacity so use a separate variable for the number of bytes to allocate. libstdc++-v3/ChangeLog: PR libstdc++/108097 * include/std/stacktrace (basic_stracktrace::_Impl): Do not multip

[committed] libstdc++: Fix self-move for std::weak_ptr [PR108118]

2022-12-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-lixnu. Pushed to trunk. I'll backport this too. -- >8 -- I think an alternative fix would be something like: _M_ptr = std::exchange(rhs._M_ptr, nullptr); _M_refcount = std::move(rhs._M_refcount); The standard's move-and-swap implementation generates smaller code at all levels

Re: Adding a new thread model to GCC

2022-12-16 Thread Jonathan Wakely via Gcc-patches
On Mon, 31 Oct 2022 at 09:19, Eric Botcazou via Libstdc++ wrote: > I have attached a revised version of the original patch at: > https://gcc.gnu.org/legacy-ml/gcc-patches/2019-06/msg01840.html > > This reimplements the GNU threads library on native Windows (except for the > Objective-C specific

[committed] libstdc++: Diagnose broken allocator rebind members

2022-12-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This adds a static assertion to std::allocator_traits::rebind_alloc to diagnose violations of the rule that rebinding an allocator to its own value type yields the same allocator type. This helps to catch the easy mistake of deriving from std::alloc

[committed] libstdc++: Fixes for std::expected

2022-12-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. I'll backport to gcc-12 too. -- >8 -- This fixes some bugs in the swap functions for std::expected. It also disables the noexcept-specifiers for equality operators, because those are problematic when querying whether a std::expected is equality comparable. T

[committed] libstdc++: Add monadic operations to std::expected for C++23 (P2505R5)

2022-12-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This was approved for C++23 last month in Kona. libstdc++-v3/ChangeLog: * include/std/expected (expected): Add monadic operations. (expected): Likewise. * include/std/version (__cpp_lib_expected): Bump value. * tests

Re: [PATCH 3/3] contrib: Add dg-out-generator.pl

2022-12-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Dec 2022 at 10:49, Arsen Arsenović wrote: > > This script is a helper used to generate dg-output lines from an existing > program output conveniently. It takes care of escaping Tcl and ARE stuff. > > contrib/ChangeLog: > > * dg-out-generator.pl: New file. > --- > contrib/dg-ou

Re: [PATCH] libstdc++: Don't call 4-5 argument to_chars with chars_format{}

2022-12-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Dec 2022 at 08:47, Jakub Jelinek wrote: > > Hi! > > In Fedora build libstdc++.so is built with assertions enabled and > FAIL: 20_util/to_chars/float128_c++23.cc execution test > was failing on all arches. The problem is that it called 5 argument version > of to_chars with chars_format{

[committed] libstdc++: Add [[nodiscard]] in

2022-12-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/chrono: Use nodiscard attribute. --- libstdc++-v3/include/std/chrono | 46 + 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/libstdc++-v3/include/std/chro

[committed] libstdc++: Define and use variable templates in

2022-12-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Thi defines a variable template for the internal __is_duration helper trait, defines a new __is_time_point_v variable template (to be used in a subsequent commit), and adds explicit specializations of the standard chrono::treat_as_floating_point trai

Re: [PATCH 1/3] libstdc++: Improve output of default contract violation handler [PR107792]

2022-12-22 Thread Jonathan Wakely via Gcc-patches
On Thu, 22 Dec 2022 at 21:41, Jason Merrill via Libstdc++ wrote: > > On 12/22/22 06:03, Arsen Arsenović wrote: > > From: Jonathan Wakely > > > > Make the output more readable. Don't output anything unless verbose > > termination is enabled at configure-time. > > LGTM if Jonathan agrees. The test

[committed] libstdc++: Add GDB printers for types

2022-12-22 Thread Jonathan Wakely via Gcc-patches
These should really have tests for the new types, but I've been using them heavily for a few weeks and they work well. I would rather get them committed now and add tests later. Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (Std

[committed] libstdc++: Implement C++20 time zone support in

2022-12-22 Thread Jonathan Wakely via Gcc-patches
This is the finished version of the last patch I posted before the end of stage 1. This is quite late for stage 1 (!) and adds new symbols to the shared library, but I'm pushing it now as it's an important piece of C++20 support. As noted in the commit message, the symbols being added are stable pa

[committed] libstdc++: Add helper function in

2022-12-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, sparc-solaris2.11, powerpc-aix. Pushed to trunk. -- >8 -- Add a new __format::__write_padded_as_spec helper to remove duplicated code in formatter specializations. libstdc++-v3/ChangeLog: * include/std/format (__format::__write_padded_as_spec): New function.

[committed] libstdc++: Add std::format support to

2022-12-22 Thread Jonathan Wakely via Gcc-patches
Another big missing piece of C++20 support, but header-only this time so no new symbol exports. The last thing missing for C++20 is std::chrono::parse. Tested x86_64-linux, sparc-solaris2.11, powerpc-aix. Pushed to trunk. -- >8 -- This adds the operator<< overloads and std::formatter specializa

[committed] libstdc++: Avoid recursion in __nothrow_wait_cv::wait [PR105730]

2022-12-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-12 needed too. -- >8 -- The commit r12-5877-g9e18a25331fa25 removed the incorrect noexcept-specifier from std::condition_variable::wait and gave the new symbol version @@GLIBCXX_3.4.30. It also redefined the original symbol std::condition_vari

Re: build broke, cris-elf: [committed] libstdc++: Implement C++20 time zone support in

2022-12-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Dec 2022 at 02:15, Hans-Peter Nilsson via Libstdc++ wrote: > > > From: Jonathan Wakely via Gcc-patches > > Date: Fri, 23 Dec 2022 00:37:04 +0100 > > > This is the largest missing piece of C++20 support. Only the cxx11 ABI > > is supported, due to the use

[committed] libstdc++: Remove problematic static_assert from src/c++20/tzdb.cc

2022-12-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This assertion fails for cris-elf where sizeof(datetime) is only 7, due to lower alignment requirements. The assertion was used while I was writing the code to check that the objects were as compact as I wanted, but it doesn't need to be kept now. l

Re: build broke, cris-elf: [committed] libstdc++: Implement C++20 time zone support in

2022-12-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Dec 2022 at 09:29, Jonathan Wakely wrote: > > On Fri, 23 Dec 2022 at 02:15, Hans-Peter Nilsson via Libstdc++ > wrote: > > > > > From: Jonathan Wakely via Gcc-patches > > > Date: Fri, 23 Dec 2022 00:37:04 +0100 > > > > > This is the

[committed] libstdc++: Fix Darwin bootstrap error in src/c++20/tzdb.cc

2022-12-23 Thread Jonathan Wakely via Gcc-patches
A fix for another bootstrap error caused by yesterday's C++20 time zone commit, for macOS this time. I have only tested on x86_64-linux but Iain confirmed this works for his darwin testers. Pushed to trunk. -- >8 -- Mach-O requires weak symbols to have a definition, so add a default implementati

Re: [PATCH] libstdc++, configure: Fix GLIBCXX_ZONEINFO_DIR configuration macro.

2022-12-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Dec 2022, 17:06 Iain Sandoe via Libstdc++, wrote: > This is a patch for comment on the approach - tested on x86_64-darwi21 > thoughts? > Iain > > --- 8< --- > > Testing on Darwin revealed that the GLIBCXX_ZONEINFO_DIR was not doing > quite > the right thing (we ended up with ${with

Re: [PATCH] libstdc++, configure: Fix GLIBCXX_ZONEINFO_DIR configuration macro.

2022-12-24 Thread Jonathan Wakely via Gcc-patches
On Sat, 24 Dec 2022, 09:56 Iain Sandoe, wrote: > Hi, > > > On 23 Dec 2022, at 23:17, Jonathan Wakely wrote: > > > > On Fri, 23 Dec 2022, 17:06 Iain Sandoe via Libstdc++, < > libstd...@gcc.gnu.org> wrote: > > This is a patch for comment on the approach - tested on x86_64-darwi21 > > thoughts? >

Re: [PATCH] libstdc++: Test for tzdata.zi before fallback version files.

2022-12-24 Thread Jonathan Wakely via Gcc-patches
On Sat, 24 Dec 2022, 11:40 Iain Sandoe via Libstdc++, wrote: > I tested this (along with the other posted patches for zoneinfo) using > an installation built from the 2022g release on x86_64-darwin21. Wider > testing will follow. If we are in an installation without the tzdata.zi > then althoug

Re: [PATCH] libstdc++, testsuite: Correct an init.

2022-12-24 Thread Jonathan Wakely via Gcc-patches
On Sat, 24 Dec 2022, 11:43 Iain Sandoe via Libstdc++, wrote: > Noticed while debugging tz info support on Darwin, unless I miss > some other reasoning... > OK for trunk? > Doh, thanks. OK for trunk. Iain > > --- 8< --- > > in leap_seconds.cc, we are testing to see if the function that > overri

Re: [PATCH] libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol.

2022-12-24 Thread Jonathan Wakely via Gcc-patches
On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, wrote: > If this is not the right place to export the symbol (or you do not want > to export it in the general case), I can always add a platform-specific > file for it. So far, tested on x86_64-darwin21, wider testing will > follow over

[committed] libstdc++: Fix std::array::data() to be a constant expression [PR108258]

2023-01-04 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- When I refactored the __array_traits helper I broke this. libstdc++-v3/ChangeLog: PR libstdc++/108258 * include/std/array (__array_traits::operator T*()): Add constexpr. * testsuite/23_containers/array/element_access

Re: [PATCH] libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol.

2023-01-04 Thread Jonathan Wakely via Gcc-patches
On Sat, 24 Dec 2022 at 12:21, Iain Sandoe wrote: > > > > > On 24 Dec 2022, at 12:12, Jonathan Wakely wrote: > > > > > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, > > wrote: > > If this is not the right place to export the symbol (or you do not want > > to export it in the gener

Re: [PATCH] libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol.

2023-01-04 Thread Jonathan Wakely via Gcc-patches
On Wed, 4 Jan 2023 at 17:14, Jakub Jelinek wrote: > > On Wed, Jan 04, 2023 at 03:17:42PM +, Jonathan Wakely via Gcc-patches > wrote: > > On Sat, 24 Dec 2022 at 12:21, Iain Sandoe wrote: > > > > > > > > > > > >

[committed] libstdc++: Fix std::chrono::hh_mm_ss with unsigned rep [PR108265]

2023-01-04 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk, backports to gcc-11 and gcc-12 will follow. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/108265 * include/std/chrono (hh_mm_ss): Do not use chrono::abs if duration rep is unsigned. * testsuite/std/time/hh_mm_ss/1.cc: Check un

[committed] libstdc++: Only use std::atomic if lock free [PR108228]

2023-01-04 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This fixes linker errors for hppa-hp-hpux11.11 due to an undefined weak symbol and the use of atomic operations that require libatomic. The weak symbol can simply be defined, which we already do for darwin. The std::atomic<_Node*> is only an optimi

<    15   16   17   18   19   20   21   22   23   24   >