Re: [PATCH] libstdc++: mark variables as possibly unused

2020-09-10 Thread Jonathan Wakely via Gcc-patches
On 28/08/20 08:40 +0200, Krystian Kuźniarek via Libstdc++ wrote: Test suite confirmation: All tests pass. Tested on both Manjaro and some Ubuntu 18.04 with gcc10 and gcc8 respectively. Thanks. Jonathan, one more thing. I hope it's what you asked for cause all I did was: make bootstrap Ther

Re: [PATCH] libstdc++: fix misleading indentation

2020-09-10 Thread Jonathan Wakely via Gcc-patches
On 24/08/20 13:26 +0200, Krystian Kuźniarek via Libstdc++ wrote: Hi, First of all, sorry, I must have sent it as quoted-printable so spaces and tabs are preserved. A description of the problem/bug and how your patch addresses it: I've got a small patch for -Wmisleading-indentation in system hea

Re: [PATCH] libstdc++: add parentheses around assignments used as truth values

2020-09-10 Thread Jonathan Wakely via Gcc-patches
On 24/08/20 13:26 +0200, Krystian Kuźniarek via Libstdc++ wrote: Hi, A description of the problem/bug and how your patch addresses it: I've got a small patch for -Wparentheses in system headers. Thanks, I'll commit this one too. Testcases: N/A, it's only a warning. ChangeLog: Sorry, contrib

[committed] libstdc++: Enforce LWG 3472 preconditions on std::counted_iterator

2020-09-10 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (counted_iterator): Add assertions to check preconditions added by LWG 3472. Tested powerpc64le-linux. Committed to trunk. commit afea21f9612545282db95872021d7587c9d5b0d4 Author: Jonathan Wakely Date: Thu Sep 10 17:09:15 20

[committed] libstdc++: Fix some -Wunused-parameter warnings

2020-09-10 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/codecvt.h (codecvt_byname): Remove names of unused parameters. Tested powerpc64le-linux. Committed to trunk. commit 36efcd7de0431b099087d8ae1ad358b0e088a250 Author: Jonathan Wakely Date: Thu Sep 10 17:09:16 2020 libstdc++: Fix some -

[PATCH] libstdc++: Install precompiled header

2020-09-10 Thread Jonathan Wakely via Gcc-patches
This header was added to the source tree years ago, but doesn't actually get precompiled or installed when building the library. This change installs it alongside the other precompiled headers, and also updates it to include the Filesystem TS and all LFTS headers (but not the Networking TS ones).

[committed 1/5] libstdc++: Fix -Wnarrowing warnings

2020-09-10 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/fs_path.h (path::_List::type()): Avoid narrowing conversion. * include/std/chrono (operator+(const year&, const years&)): Likewise. Tested powerpc64le-linux. Committed to trunk. commit b6b9fd4af9ac46a8bb19a906e4c2afa14da91017

[committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings

2020-09-10 Thread Jonathan Wakely via Gcc-patches
* include/experimental/bits/shared_ptr.h (shared_ptr(auto_ptr&&)) (operator=(auto_ptr&&)): Add diagnostic pragmas to suppress warnings for uses of std::auto_ptr. * include/experimental/type_traits (is_literal_type_v): Likewise, for use of

[committed 2/5] libstdc++: Fix macro redefinition warnings

2020-09-10 Thread Jonathan Wakely via Gcc-patches
Including after gives a warning about redefining the __cpp_lib_array_constexpr macro. What happens is that sets the C++20 value, then redefines it to the C++17 value, then undefines it and defines it again to the C++20 value. This change avoids defining it to the C++17 value when compiling C+

[committed 4/5] libstdc++: Fix -Wunused-local-typedefs warning

2020-09-10 Thread Jonathan Wakely via Gcc-patches
* include/bits/ranges_algobase.h (__equal_fn): Remove unused typedef. Tested powerpc64le-linux. Committed to trunk. commit 866c53cb2e88e172476185327723df9197c34ae7 Author: Jonathan Wakely Date: Thu Sep 10 18:57:05 2020 libstdc++: Fix -Wunused-local-typedefs warning

[committed 5/5] libstdc++: Fix -Wsign-compare warnings

2020-09-10 Thread Jonathan Wakely via Gcc-patches
* include/bits/locale_conv.h (__do_str_codecvt, __str_codecvt_in_all): Add casts to compare types of the same signedness. Tested powerpc64le-linux. Committed to trunk. commit 1d5589d11e61fa78b0c0e845728412b1cc6043d8 Author: Jonathan Wakely Date: Thu Sep 10 18:57:39 2

Re: [PATCH v5 5/8] libstdc++ futex: Loop when waiting against arbitrary clock

2020-09-11 Thread Jonathan Wakely via Gcc-patches
I'm finally getting round to merging this series! On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: If std::future::wait_until is passed a time point measured against a clock that is neither std::chrono::steady_clock nor std::chrono::system_clock then the generic implementation of __atom

Re: [PATCH] libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions.

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 12:23 +, Christophe Lyon via Libstdc++ wrote: When building with -fno-exceptions, __GLIBCXX_THROW_OR_ABORT expands to abort(), causing warnings: unused parameter '__ecode' unused parameter '__what' This patch adds __attribute__((unused)) to avoid them. OK, thanks. 2020-09-11

Re: [PATCH] libstdc++-v3/libsupc++/eh_call.cc: Avoid warning with -fno-exceptions.

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 12:23 +, Christophe Lyon via Libstdc++ wrote: When building with -fno-exceptions, __throw_exception_again expands to nothing, causing a "suggest braces around empty body in an 'if' statement" warning. This patch adds braces, like what was done in eh_personality.cc in svn r193295

Re: [PATCH] libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 12:23 +, Christophe Lyon via Libstdc++ wrote: When building with -fno-exceptions, bad_exception_allowed is set but not used, causing a warning during the build. This patch adds __attribute__((unused)) to avoid it. OK, thanks. 2020-09-11 Torbjörn SVENSSON Christoph

Re: [PATCH v5 0/8] std::future::wait_* and std::condition_variable improvements

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: This series ensures that the std::future::wait_* functions use std::chrono::steady_clock when required, introduces std::chrono::__detail::ceil to make that easier to do, and then makes use of that function to simplify and improve the fix fo

Re: [PATCH] libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions.

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 13:55 +0100, Jonathan Wakely wrote: On 11/09/20 12:23 +, Christophe Lyon via Libstdc++ wrote: When building with -fno-exceptions, __GLIBCXX_THROW_OR_ABORT expands to abort(), causing warnings: unused parameter '__ecode' unused parameter '__what' This patch adds __attribute__((un

Re: [PATCH] libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions.

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 14:37 +0100, Jonathan Wakely wrote: On 11/09/20 13:55 +0100, Jonathan Wakely wrote: On 11/09/20 12:23 +, Christophe Lyon via Libstdc++ wrote: When building with -fno-exceptions, __GLIBCXX_THROW_OR_ABORT expands to abort(), causing warnings: unused parameter '__ecode' unused para

Re: [PATCH v5 6/8] libstdc++ atomic_futex: Avoid rounding errors in std::future::wait_* [PR91486]

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: Convert the specified duration to the target clock's duration type before adding it to the current time in __atomic_futex_unsigned::_M_load_when_equal_for and _M_load_when_equal_until. This removes the risk of the timeout being rounded dow

Re: [PATCH v5 6/8] libstdc++ atomic_futex: Avoid rounding errors in std::future::wait_* [PR91486]

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 15:41 +0100, Jonathan Wakely wrote: On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: Convert the specified duration to the target clock's duration type before adding it to the current time in __atomic_futex_unsigned::_M_load_when_equal_for and _M_load_when_equal_until. This

Re: [PATCH v5 6/8] libstdc++ atomic_futex: Avoid rounding errors in std::future::wait_* [PR91486]

2020-09-11 Thread Jonathan Wakely via Gcc-patches
On 11/09/20 18:22 +0100, Jonathan Wakely wrote: On 11/09/20 15:41 +0100, Jonathan Wakely wrote: On 29/05/20 07:17 +0100, Mike Crowe via Libstdc++ wrote: Convert the specified duration to the target clock's duration type before adding it to the current time in __atomic_futex_unsigned::_M_load_wh

Re: [committed] libstdc++: Fix invalid noexcept-specifier (PR 94117)

2020-03-10 Thread Jonathan Wakely via Gcc-patches
On 10/03/20 11:40 +, Jonathan Wakely wrote: G++ fails to diagnose this non-dependent expression, but Clang doesn't like it. PR c++/94117 * include/std/ranges (ranges::transform_view::_Iterator::iter_move): Change expression in noexcept-specifier to match function body

Re: [PATCH] libstdc++: LWG 3286 ranges::size is not required to be valid after ...

2020-03-10 Thread Jonathan Wakely via Gcc-patches
On 09/03/20 14:17 -0400, Patrick Palka wrote: ... a call to ranges::begin on an input range. This implements LWG 3286. The new wording for the single-argument subrange::subrange constructor is implemented by splitting the constructor into two delegating constructors, one constrained by _S_store

Re: [committed] libstdc++: Fix invalid noexcept-specifier (PR 94117)

2020-03-10 Thread Jonathan Wakely via Gcc-patches
On 10/03/20 17:52 +, Jonathan Wakely wrote: On 10/03/20 11:40 +, Jonathan Wakely wrote: G++ fails to diagnose this non-dependent expression, but Clang doesn't like it. PR c++/94117 * include/std/ranges (ranges::transform_view::_Iterator::iter_move): Change expres

Re: ODR violation in ranges

2020-03-11 Thread Jonathan Wakely via Gcc-patches
On 11/03/20 06:08 -0400, Nathan Sidwell wrote: Jonathan, the ranges header contains code like: inline constexpr __adaptor::_RangeAdaptorClosure all = [] (_Range&& __r) { if constexpr (view>) return std::forward<_Range>(__r); else if constexpr (requires { ref_view{std::forward<_Ran

Re: ODR violation in ranges

2020-03-11 Thread Jonathan Wakely via Gcc-patches
On 11/03/20 10:56 +, Tam S. B. via Libstdc++ wrote: IIUC using lambda in inline variable initializer is not ODR violation. This is covered in CWG 2300 ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1510r0.html#2300 ). Ah yes, I think somebody (probably Patrick) has pointed out

Re: [PATCH] libstdc++: Add a test that takes the split_view of a non-forward range

2020-03-11 Thread Jonathan Wakely via Gcc-patches
On 11/03/20 11:46 -0400, Patrick Palka wrote: This adds a tests that verifies taking the split_view of a non-forward range works correctly. Doing so revealed a typo in one of _OuterIter's constructors. Oops! It also revealed that the default constructor of __gnu_test::test_range::iterator mi

Re: [PATCH] libstdc++: Fix the return type of __cxa_finalize according to the Itanium C++ ABI

2020-03-12 Thread Jonathan Wakely via Gcc-patches
Please CC libstd...@gcc.gnu.org for all libstdc++ patches, as per https://gcc.gnu.org/lists.html On 11/03/20 21:24 -0700, Fangrui Song wrote: Alternatively, we can delete it, because no user code should call it. It may be weird that libc is expected to define this function. This function is a la

[committed] libstdc++: Fix test failure due to -Wnonnull warnings

2020-03-12 Thread Jonathan Wakely via Gcc-patches
This test fails in the Fedora RPM build (but not elsewhere, for unknown reasons). The warning is correct, we're passing a null pointer. * testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass a null pointer to functions with nonnull(1) attribute. Tested x86_64-linux, c

Re: [PATCH] Fix Hashtable node manipulation when custom pointer

2020-03-12 Thread Jonathan Wakely via Gcc-patches
On 12/03/20 19:33 +0100, François Dumont via Libstdc++ wrote: I wonder if this fix is correct because if it is you spent more time making ext_ptr.cc works than fixing it :-) I don't remember the details, but I think this is not correct. We need to store the fancy pointer, not a raw pointer. Sim

Re: [PATCH] libstdc++: Skip 91371.cc for x32.

2020-03-16 Thread Jonathan Wakely via Gcc-patches
On 13/03/20 20:38 +0100, Uros Bizjak via Libstdc++ wrote: x32 does not support MS ABI, skip testcases that require it. 2020-03-13 Uroš Bizjak * testsuite/20_util/bind/91371.cc: Skip for x32. * testsuite/20_util/is_function/91371.cc: Ditto. * testsuite/20_util/is_member_function_poin

[committed] libstdc++: Add default constructor to net::service_already_exists (PR 94199)

2020-03-16 Thread Jonathan Wakely via Gcc-patches
The service_already_exists exception type specified in the TS doesn't have any constructors defined. Since its base class isn't default constructible, that means has no usable constructors. This may be a defect in the TS. This patch fixes it by adding a default constructor, but making it private.

Re: [committed] libstdc++: Add default constructor to net::service_already_exists (PR 94199)

2020-03-17 Thread Jonathan Wakely via Gcc-patches
On 17/03/20 12:01 +0100, Christophe Lyon wrote: Hi, On Mon, 16 Mar 2020 at 23:54, Jonathan Wakely via Gcc-patches wrote: The service_already_exists exception type specified in the TS doesn't have any constructors defined. Since its base class isn't default constructible, that me

Re: [PATCH] c++: Fix access checking for __is_assignable and __is_constructible (c++/94197)

2020-03-17 Thread Jonathan Wakely via Gcc-patches
Shouldn't the test use { dg-do compile { target c++11 } } instead of: +// { dg-do compile } +// { dg-options "-std=c++11" } ?

Re: [PATCH] c++: Fix access checking for __is_assignable and __is_constructible (c++/94197)

2020-03-17 Thread Jonathan Wakely via Gcc-patches
On 17/03/20 13:02 +, Jonathan Wakely wrote: Shouldn't the test use { dg-do compile { target c++11 } } instead of: +// { dg-do compile } +// { dg-options "-std=c++11" } ? With that change I see: UNSUPPORTED: g++.dg/ext/pr94197.C -std=c++98 PASS: g++.dg/ext/pr94197.C -std=c++14 (test fo

[committed] libstdc++: Fix type-erasure in experimental::net::executor (PR 94203)

2020-03-17 Thread Jonathan Wakely via Gcc-patches
The _Tgt and _TgtImpl types that implement type-erasure didn't agree on the virtual interface, so failed as soon as they were instantiated. With Clang they failed even sooner. The interface was also dependent on whether RTTI was enabled or not. This patch fixes the broken virtual functions and mak

[committed 1/2] libstdc++: Fix compilation with released versions of Clang

2020-03-18 Thread Jonathan Wakely via Gcc-patches
Clang 9 supports C++20 via -std=c++2a but doesn't support Concepts, so several of the new additions related to the Ranges library fail to compile with -std=c++2a. The new definition of iterator_traits and the definition of default_sentinel_t are guarded by __cpp_lib_concepts, so check that in addit

[committed 2/2] libstdc++: Fix compilation of with Clang

2020-03-18 Thread Jonathan Wakely via Gcc-patches
Clang 9 supports C++20 via -std=c++2a but doesn't support three-way comparisons, so fails to compile. When the compiler doesn't support default comparisons, this patch defines operator== and operator!= for the _Stop_state_ref class. That is enough for the header to be compiled with Clang. It allo

[committed] libstdc++: Fix is_trivially_constructible (PR 94033)

2020-03-18 Thread Jonathan Wakely via Gcc-patches
This attempts to make is_nothrow_constructible more robust (and efficient to compile) by not depending on is_constructible. Instead the __is_constructible intrinsic is used directly. The helper class __is_nt_constructible_impl which checks whether the construction is non-throwing now takes a bool t

[committed] libstdc++: Fix path::generic_string allocator handling (PR 94242)

2020-03-21 Thread Jonathan Wakely via Gcc-patches
It's not possible to construct a path::string_type from an allocator of a different type. Create the correct specialization of basic_string, and adjust path::_S_str_convert to use a basic_string_view so that it is independent of the allocator type. PR libstdc++/94242 * include/bits

[committed] libstdc++: Fix experimental::path::generic_string (PR 93245)

2020-03-21 Thread Jonathan Wakely via Gcc-patches
This function was unimplemented, simply returning the native format string instead. PR libstdc++/93245 * include/experimental/bits/fs_path.h (path::generic_string()): * testsuite/experimental/filesystem/path/generic/generic_string.cc: Improve test coverage. Tested

[committed] libstdc++: Define and use chrono::is_clock for C++20

2020-03-25 Thread Jonathan Wakely via Gcc-patches
For C++20 the wait_until members of mutexes and condition variables are required to be ill-formed if given a clock that doesn't meet the requirements for a clock type. To implement that requirement this patch adds static assertions using the chrono::is_clock trait, and defines that trait. To avoid

[committed] libstdc++ Add missing tests for std::shared_timed_mutex

2020-03-25 Thread Jonathan Wakely via Gcc-patches
These tests were supposed to be committed as part of r278904 (aka b789efeae8c0620b83f25e4a0757c4871e02ab5f) but I didn't 'git add' them. * testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New test. * testsuite/30_threads/shared_timed_mutex/try_lock_until/2.cc: N

[committed] libstdc++: Whitespace changes to keep lines below 80 columns

2020-07-07 Thread Jonathan Wakely via Gcc-patches
Also remove leading spaces that are followed by tabs. libstdc++-v3/ChangeLog: * include/std/limits: Whitespace changes. Committed to trunk. commit 9ca8fefeb720c8a9dec58e9a99042e6727309251 Author: Jonathan Wakely Date: Tue Jul 7 23:26:38 2020 +0100 libstdc++: Whitespace changes t

[committed] libstdc++: Replace __int_limits with __numeric_traits_integer

2020-07-07 Thread Jonathan Wakely via Gcc-patches
I recently added std::__detail::__int_limits as a lightweight alternative to std::numeric_limits, forgetting that the values it provides (digits, min and max) are already provided by __gnu_cxx::__numeric_traits. This change adds __int_traits as an alias for __numeric_traits_integer. This avoids in

Re: [committed] libstdc++: Whitespace changes to keep lines below 80 columns

2020-07-07 Thread Jonathan Wakely via Gcc-patches
On 07/07/20 23:38 +0100, Jonathan Wakely wrote: Also remove leading spaces that are followed by tabs. libstdc++-v3/ChangeLog: * include/std/limits: Whitespace changes. I missed a couple of leading spaces, fixed with this one. Committed to trunk. commit 161aa50ee2d1142802d7200733fee1

Re: Inconsistencies with associative/unordered containers

2020-07-07 Thread Jonathan Wakely via Gcc-patches
On 03/07/20 08:37 +0200, François Dumont via Libstdc++ wrote: Hi     Here is the patch to fix the 2nd point of this mail below.     I prefer to qualify _Rb_tree_impl move constructor based on std::is_nothrow_move_constructible<_Base_key_compare> so that the logic of copying _Compare ra

Re: [PATCH] Add C++2a synchronization support

2020-07-08 Thread Jonathan Wakely via Gcc-patches
On 05/06/20 17:29 -0700, Thomas Rodgers wrote: Add support for - atomic wait/notify_one/notify_all counting_semaphore binary_semaphore latch * include/Makefile.am (bits_headers): Add new header. * include/Makefile.in: Regenerate. * include/bits/

[committed] libstdc++: Fix istream::ignore exit conditions (PR 94749, PR 96161)

2020-07-13 Thread Jonathan Wakely via Gcc-patches
My previous fix for PR 94749 did fix the reported case, so that the next character is not discarded if it happens to equal the delimiter when __n characters have already been read. But it introduced a new bug, which is that the delimiter character would *not* be discarded if the number of character

Re: [PATCH] analyzer: Fix -Wanalyzer-possible-null-argument warning

2020-07-16 Thread Jonathan Wakely via Gcc-patches
On 06/07/20 11:27 +0100, Jonathan Wakely wrote: On 05/07/20 21:48 -0400, David Malcolm wrote: On Wed, 2020-07-01 at 18:29 +0100, Jonathan Wakely wrote: On 30/06/20 17:43 +0100, Jonathan Wakely wrote: gcc/testsuite/ChangeLog: * g++.dg/analyzer/pr94028.C: Make operator new non-throwing

[committed] gcc-changelog: Fix typo in output

2020-07-17 Thread Jonathan Wakely via Gcc-patches
contrib/ChangeLog: * gcc-changelog/git_update_version.py: Fix typo. Committed as obvious. commit 0c1d1c01039a96c191a7aded40e5df40b14d387a Author: Jonathan Wakely Date: Fri Jul 17 09:53:19 2020 gcc-changelog: Fix typo in output contrib/ChangeLog: * gcc-ch

Re: [PATCH] libstdc++, coroutine: Add missing constexpr markers.

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/07/20 10:05 +0100, Iain Sandoe wrote: Hi As per http://eel.is/c++draft/coroutine.trivial.awaitables the methods for the trivial awaitables are supposed to be constexpr. tested on x86_64-linux, darwin powerpc64-linux, OK for master? for 10.3? OK for both, thanks.

Re: [PATCH v5 0/8] std::future::wait_* and std::condition_variable improvements

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/07/20 09:39 +0100, Mike Crowe via Libstdc++ wrote: On Friday 29 May 2020 at 07:17:26 +0100, Mike Crowe wrote: This series ensures that the std::future::wait_* functions use std::chrono::steady_clock when required, introduces std::chrono::__detail::ceil to make that easier to do, and then m

Re: [PATCH][Hashtable 1/6] Code simplification/optimization

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/11/19 21:51 +0100, François Dumont wrote: This patch simplifies a number of implementations. It tries as much as possible to avoid computing hash code. This is especially true for the erase implementation in case of multi keys.     * include/bits/hashtable_policy.h (_Map_base<>::at

Re: [PATCH][Hashtable 2/6] Avoid over-sizing container

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/11/19 21:56 +0100, François Dumont wrote: This patch avoids over-sizing of the container by rather considering the bucket count hint or potential reservation. It concerns only the non-multi containers.     * include/bits/hashtable.h     (_Hashtable<>(_InputIterator, _InputIterator

Re: [PATCH][Hashtable 3/6] Fix noexcept qualifications

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/11/19 21:59 +0100, François Dumont wrote: This patch adds noexcept qualification on allocator aware constructors and fix the one on the default constructor.     * include/bits/hashtable.h     (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)):     Add noexcept q

Re: [PATCH][Hashtable 0/6] Code review

2020-07-17 Thread Jonathan Wakely via Gcc-patches
N.B. the 0/6 entry of a patch series is supposed to be a cover letter describing the changes in the series, not one of the patches. If you have patches 0/6, 1/6, 2/6 ... 6/6 then you actually have seven patches, not six! Anyway ... On 19/12/19 20:17 +0100, François Dumont wrote: diff --git a/

Re: std::vector code cleanup fixes optimizations

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 16/12/19 08:18 +0100, François Dumont wrote: A small refresh on this patch now tested also for versioned namespace which require printers.py to be updated. Note that this simplification works also for normal mode so I can apply it independently from the stl_bvector.h part.     * incl

Re: [PATCH][Hashtable 4/6] Clean local_iterator implementation

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/11/19 22:03 +0100, François Dumont wrote: Simplify local_iterator implementation. It makes local_iterator and iterator comparable which is used in debug containers.     * include/bits/hashtable_policy.h (_Node_iterator_base()): New.     (operator==(const _Node_iterator_base&, const

Re: [PATCH][Hashtable 5/6] Remove H1/H2 template parameters

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 19/11/19 00:10 +0200, Ville Voutilainen wrote: On Mon, 18 Nov 2019 at 23:41, François Dumont wrote: > Also, is > this ABI-compatible > for our unordered containers? > IMHO, yes it is. In hashtable_policy.h _H1 was the user hash which I renamed in _Hash, the same template name that for un

Re: [PATCH][Hashtable 5/6] Remove H1/H2 template parameters

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 19/12/19 20:22 +0100, François Dumont wrote: Because of this change printers.py has to be updated too. François On 11/17/19 10:15 PM, François Dumont wrote: H1 used to be a reference to the user Hash, now _Hashtable and unordered types agree on the same Hash type which is more intuitive

Re: [PATCH][Hashtable 6/6] PR 68303 small size optimization

2020-07-17 Thread Jonathan Wakely via Gcc-patches
On 17/11/19 22:31 +0100, François Dumont wrote: This is an implementation of PR 68303. I try to use this idea as much as possible to avoid computation of hash codes. Note that tests are not showing any gain. I guess hash computation must be quite bad to get a benefit from it. So I am only a

Re: [ PATCH ] [ C++ ] [ libstdc++ ] P0674r1 - Extend support for arrays in make/allocate_shared

2020-07-17 Thread Jonathan Wakely via Gcc-patches
Sorry for the late review. I hope you're still willing to work on this! On 02/01/20 17:16 -0500, JeanHeyd Meneide wrote: Glen Fernandes is already working on a patch, so I decided to finish off my changes and throw them up on the Patch List so that Glen can access the tests parts that I had wri

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Jonathan Wakely via Gcc-patches
On 19/07/20 23:37 -0400, Patrick Palka via Libstdc++ wrote: On Fri, 17 Jul 2020, Patrick Palka wrote: On Fri, 17 Jul 2020, Patrick Palka wrote: > On Wed, 15 Jul 2020, Patrick Palka wrote: > > > On Tue, 14 Jul 2020, Patrick Palka wrote: > > > > > This implements the floating-point std::to_chars

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Jonathan Wakely via Gcc-patches
On 20/07/20 08:53 -0400, Patrick Palka via Libstdc++ wrote: On Mon, 20 Jul 2020, Jonathan Wakely wrote: On 19/07/20 23:37 -0400, Patrick Palka via Libstdc++ wrote: > On Fri, 17 Jul 2020, Patrick Palka wrote: > > > On Fri, 17 Jul 2020, Patrick Palka wrote: > > > > > On Wed, 15 Jul 2020, Patrick

[committed] libstdc++: Avoid overflow in istream::get(streambuf&) [LWG 3464]

2020-07-20 Thread Jonathan Wakely via Gcc-patches
Similar to the recent changes to basic_istream::ignore, this change ensures that _M_gcount doesn't overflow when extracting characters and inserting them into another streambuf. The solution used here is to use unsigned long long for the count. We assume that the number of characters extracted won

[committed] libstdc++: Add std::from_chars for floating-point types

2020-07-20 Thread Jonathan Wakely via Gcc-patches
This adds the missing std::from_chars overloads for floating-point types, as required for C++17 conformance. The implementation is a hack and not intended to be used in the long term. Rather than parsing the string directly, this determines the initial portion of the string that matches the patter

Re: [committed] libstdc++: Add std::from_chars for floating-point types

2020-07-21 Thread Jonathan Wakely via Gcc-patches
On 21/07/20 07:56 +0200, Florian Weimer wrote: * Jonathan Wakely via Libstdc: By replacing the use of strtod we could avoid allocation, avoid changing locale, and use optimised code paths specific to each std::chars_format case. We would also get more portable behaviour, rather than depending o

[committed] libstdc++: Constrain reverse_iterator and move_iterator conversions [LWG 3435]

2020-07-22 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (reverse_iterator): Constrain converting constructor and converting assignment operator. Access source iterator's data member directly instead of calling base(). (move_iterator): Likewise. * tests

Re: [committed] libstdc++: Add std::from_chars for floating-point types

2020-07-22 Thread Jonathan Wakely via Gcc-patches
On 21/07/20 20:08 +, Joseph Myers wrote: On Tue, 21 Jul 2020, Jonathan Wakely via Gcc-patches wrote: I also noticed some strings give an underflow error with glibc's strtod, but are valid for the Microsoft implementation. For example, this one: https://github.com/microsoft/STL/blob/m

[committed] libstdc++: Add static assertions to futures and promises [LWG 3458]

2020-07-22 Thread Jonathan Wakely via Gcc-patches
LWG recently decided it should be ill-formed to instantiate std::future and std::shared_future for types that can't be returned from a function. This adds static assertions to enforce it (std::future already failed, but this makes the error more understandable). LWG 3466 extends that to std::promi

Re: [committed] libstdc++: Add std::from_chars for floating-point types

2020-07-27 Thread Jonathan Wakely via Gcc-patches
On 27/07/20 11:41 +0200, Rainer Orth wrote: Hi Jonathan, This adds the missing std::from_chars overloads for floating-point types, as required for C++17 conformance. The implementation is a hack and not intended to be used in the long term. Rather than parsing the string directly, this determi

Re: [committed] libstdc++: Add std::from_chars for floating-point types

2020-07-28 Thread Jonathan Wakely via Gcc-patches
On 27/07/20 10:46 +0100, Jonathan Wakely wrote: On 27/07/20 11:41 +0200, Rainer Orth wrote: Hi Jonathan, This adds the missing std::from_chars overloads for floating-point types, as required for C++17 conformance. The implementation is a hack and not intended to be used in the long term. Rath

Re: [committed] libstdc++: Add std::from_chars for floating-point types

2020-07-28 Thread Jonathan Wakely via Gcc-patches
On 28/07/20 22:01 +0100, Jonathan Wakely wrote: On 27/07/20 10:46 +0100, Jonathan Wakely wrote: On 27/07/20 11:41 +0200, Rainer Orth wrote: Hi Jonathan, This adds the missing std::from_chars overloads for floating-point types, as required for C++17 conformance. The implementation is a hack a

Re: [PATCH] libstdc++ testsuite: atomic_float/value_init.cc requires libatomic

2020-07-29 Thread Jonathan Wakely via Gcc-patches
On 28/07/20 21:44 -0400, David Edelsohn via Libstdc++ wrote: atomic_float/value_init.cc requires libatomic on some targets, i.e., when it tries to perform an atomic operation with a 64 bit floating point double type on a 32 bit target. This patch adds AIX to the list of targets that require the

[PATCH] testsuite: Enable fenv effective-targets for C++

2020-07-30 Thread Jonathan Wakely via Gcc-patches
I recently wanted to use { dg-require-effective-target fenv } in a libstdc++ test, but it uses -std=gnu99 which is only valid for C. This allows C++ tests to use the fenv and fenv_exceptions effective-target keywords. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_ta

[committed] libstdc++: Make testsuite usable with -fno-exceptions

2020-07-30 Thread Jonathan Wakely via Gcc-patches
Previously it was not possible to add -fno-exceptions to the testsuite flags, because some files that are compiled by the v3-build_support procedure failed with exceptions disabled. This adjusts those files to still compile without exceptions (with degraded functionality in some cases). The sole

[committed] libstdc++: Add options for ieee float to relevant tests

2020-07-30 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/4.cc: Use dg-add-options ieee. * testsuite/29_atomics/atomic_float/1.cc: Likewise. Tested powerpc64le-linux, committed to trunk. commit eeb45f8a41f7214d8682151bff7c7f00b06a Author: Jonathan Wakely Date: Thu Jul 30 12:

[committed] libstdc++: cv bool can't be an integer-like type (LWG 3467)

2020-07-30 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/iterator_concepts.h (__detail::__cv_bool): New helper concept. (__detail::__integral_nonbool): Likewise. (__detail::__is_integer_like): Use __integral_nonbool. * testsuite/std/ranges/access/lwg3467.cc: New test. Tested

Re: [PATCH][Hashtable 3/6] Fix noexcept qualifications

2020-07-30 Thread Jonathan Wakely via Gcc-patches
On 29/07/20 11:33 +0200, François Dumont via Libstdc++ wrote: I eventually committed the attached patch which consider all your remarks and moreover put back the move constructor implementation where it used to be (not inline). It limits the size of the patch. I also added comments on true_ty

Re: [PATCH] Implement P0966 std::string::reserve should not shrink

2020-07-30 Thread Jonathan Wakely via Gcc-patches
On 12/05/19 21:22 +, Andrew Luo wrote: It's been a while, but thought I'd check in again now that GCC 9 has been branched, and master is now on GCC 10. I've merged my changes with the latest code and attached a diff... Let me know if there's any thoughts on this. Well I failed to get aro

[committed] libstdc++: Fix test for old string ABI

2020-07-30 Thread Jonathan Wakely via Gcc-patches
The COW string doesn't accept const_iterator arguments in insert and related member functions. Pass a mutable iterator instead. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/4.cc: Pass non-const iterator to string::insert. Tested x86_64-linux, committed to trunk. commit

Re: [PATCH] Implement P0966 std::string::reserve should not shrink

2020-07-30 Thread Jonathan Wakely via Gcc-patches
On 30/07/20 15:29 +0100, Jonathan Wakely wrote: On 12/05/19 21:22 +, Andrew Luo wrote: It's been a while, but thought I'd check in again now that GCC 9 has been branched, and master is now on GCC 10. I've merged my changes with the latest code and attached a diff... Let me know if there's

Re: [PATCH][Hashtable 3/6] Fix noexcept qualifications

2020-07-30 Thread Jonathan Wakely via Gcc-patches
On 29/07/20 11:33 +0200, François Dumont via Libstdc++ wrote: +using type4 = std::unordered_set, std::equal_to, + not_noexcept_dflt_cons_alloc>>; A couple of these tests use the wrong allocator type, which means they fail when compiled as C++20. Fixed with this

[committed] libstdc++: Make COW string use allocator_traits for nested types

2020-07-30 Thread Jonathan Wakely via Gcc-patches
When compiled as C++20 the COW std::string fails due to assuming that the allocator always defines size_type and difference_type. That has been incorrect since C++11, but we got away with it for specializations using std::allocator until those members were removed in C++20. libstdc++-v3/ChangeLog:

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-31 Thread Jonathan Wakely via Gcc-patches
On 31/07/20 10:19 +0200, Jakub Jelinek wrote: On Thu, Jul 30, 2020 at 05:59:18PM -0400, Jason Merrill via Gcc-patches wrote: > Even if we are guaranteed that (what guarantees it?) when __builtin_bit_cast > is constexpr evaluated no initializer will be omitted if may be value initialized > to so

[committed] libstdc++: Fix use of newlocale in std:::from_chars

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * src/c++17/floating_from_chars.cc (from_chars_impl): Use LC_ALL_MASK not LC_ALL. Tested x86_64-linux and powerpc-aix. Committed to trunk. commit 4143efc1eed44050201b20c78d0206bc266e30c4 Author: Jonathan Wakely Date: Fri Jul 31 14:36:56 2020 libst

[committed] libstdc++: Remove duplicate dg-do directive

2020-07-31 Thread Jonathan Wakely via Gcc-patches
Also add an effective target to clarify it should only run for C++17 and later. libstdc++-v3/ChangeLog: * testsuite/20_util/time_point_cast/rounding.cc: Remove duplicate dg-do directive and add c++17 effective target. Tested x86_64-linux, committed to trunk. commit 351f60794c11

[committed] libstdc++: Add -Wno-deprecated for tests that warn in C++20

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/tuple/78939.cc: Suppress warnings about deprecation of volatile-qualified structured bindings in C++20. * testsuite/20_util/variable_templates_for_traits.cc: Likewise for deprecation of is_pod in C++20 Tested x86_64-linux

[committed] libstdc++: Adjust tests that give different results in C++20

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/is_aggregate/value.cc: Adjust for changes to definition of aggregates in C++20. * testsuite/20_util/optional/requirements.cc: Adjust for defaulted comparisons in C++20. Tested x86_64-linux, committed to trunk. commit 8e

[committed] libstdc++: Remove accidental -std=gnu++17 from test

2020-07-31 Thread Jonathan Wakely via Gcc-patches
This was probably copied from a std::filesystem test and the -std option wasn't removed. libstdc++-v3/ChangeLog: * testsuite/experimental/filesystem/filesystem_error/cons.cc: Remove -std=gnu++17 option. Tested x86_64-linux, committed to trunk. commit ed0b4bb29a50d6be0e4b6411b3c

[committed] libstdc++: Remove condition around friend declaration (PR 96382)

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: PR libstdc++/96382 * include/bits/stl_iterator.h (reverse_iterator): Friend declaration should not depend on __cplusplus. Tested x86_64-linux, committed to trunk. commit 8abab28bb5c0cd80063518d47494cb6078767b89 Author: Jonathan Wakely Date: Fri

[committed 1/5] libstdc++: Ensure c++NN effective target present in all C++17 tests

2020-07-31 Thread Jonathan Wakely via Gcc-patches
Also reorder some directives so that the dg-options setting -std=gnu++17 comes before the dg-do that requires c++17. Tested powerpc64le-linux, committed to trunk. commit 6458742a15f899a7d4e7c57bc649119e8f7aa086 Author: Jonathan Wakely Date: Fri Jul 31 19:58:02 2020 libstdc++: Ensure c++N

[committed 2/5] libstdc++: Use c++NN_only effective target to tests

2020-07-31 Thread Jonathan Wakely via Gcc-patches
Some tests really are only intended for a specific -std mode, so add a target selector to make that explicit. Also reorder the dg-do directives to come after the dg-options ones, so that the target selector in the dg-do directive is applied after the dg-options that sets the -std option. libstdc+

[committed 3/5] libstdc++: Add dg-require-effective-target to std::span assert tests

2020-07-31 Thread Jonathan Wakely via Gcc-patches
The current dg directives say that the tests can run for any standard mode, but should fail for C++20. What we want is that they only run for C++20, and are always expected to fail. libstdc++-v3/ChangeLog: * testsuite/23_containers/span/back_assert_neg.cc: Split c++2a effective-ta

[committed 4/5] libstdc++: Ensure c++NN effective-target present in more tests

2020-07-31 Thread Jonathan Wakely via Gcc-patches
Add effective-target keywords to tests that would fail for certain standard modes without the -std=gnu++NN option. libstdc++-v3/ChangeLog: * testsuite/18_support/set_terminate.cc: Require C++11 or higher. * testsuite/28_regex/simple_c++11.cc: Likewise. * testsuite/

[committed 5/5] libstdc++: Avoid using __float128 in strict modes

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/26_numerics/numbers/float128.cc: Check __STRICT_ANSI__ before using __float128. * testsuite/std/concepts/concepts.lang/concept.arithmetic/floating_point.cc: Likewise. Tested powerpc64le-linux, committed to trunk. commit dc8c00

[committed 1/2] libstdc++: Fix tests that fail for C++98

2020-07-31 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/27_io/basic_istream/ignore/char/94749.cc: Use 0 instead of nullptr. * testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc: Likewise. Tested powerpc64le-linux, committed to trunk. commit 8011f718e241febd6b7a9dae01cde49817f299c

[committed 2/2] libstdc++: Fix test that fails for C++98

2020-07-31 Thread Jonathan Wakely via Gcc-patches
Local classes have no linkage so cannot be used as template arguments in C++98. libstdc++-v3/ChangeLog: * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc: Move struct to namespace scope. Tested powerpc64le-linux, committed to trunk. commit f07fa7a31c8981

Re: [committed] libstdc++: ParallelSTL is now part of oneAPI DPC++ Library

2020-07-31 Thread Jonathan Wakely via Gcc-patches
On 31/07/20 23:23 +0200, Gerald Pfeifer wrote: Pushed. (Something was off with the ChangeLog detection I'm afraid. I first got an error message and what ended up in the commit didn't look completely consistent.) I noticed the other day that this link was redirecting, but I don't think we want

<    19   20   21   22   23   24   25   26   27   28   >