Re: [PATCH] PR libstdc++/80624 satisfy invariant for char_traits::eof()

2017-05-08 Thread Jonathan Wakely via gcc-patches
On 08/05/17 09:52 +0200, Stephan Bergmann via libstdc++ wrote: On 05/05/2017 07:05 PM, Jonathan Wakely wrote: As discussed at http://stackoverflow.com/q/43769773/981959 (and kinda hinted at by http://wg21.link/lwg1200) there's a problem with char_traits::eof() because it returns int_type(-1)

Re: [PATCH] PR libstdc++/80624 satisfy invariant for char_traits::eof()

2017-05-08 Thread Jonathan Wakely via gcc-patches
On 08/05/17 11:53 +0200, Florian Weimer via libstdc++ wrote: On 05/05/2017 07:05 PM, Jonathan Wakely wrote: As discussed at http://stackoverflow.com/q/43769773/981959 (and kinda hinted at by http://wg21.link/lwg1200) there's a problem with char_traits::eof() because it returns int_type(-1)

Re: [PATCH] PR libstdc++/80624 satisfy invariant for char_traits::eof()

2017-05-08 Thread Jonathan Wakely via gcc-patches
On 08/05/17 12:52 +0200, Florian Weimer via libstdc++ wrote: On 05/08/2017 12:24 PM, Jonathan Wakely wrote: On 08/05/17 11:53 +0200, Florian Weimer via libstdc++ wrote: On 05/05/2017 07:05 PM, Jonathan Wakely wrote: As discussed at http://stackoverflow.com/q/43769773/981959 (and kinda hinted

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

[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,

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

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 {

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.

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

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

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

[committed] libstdc++: Add comparison operators to types from Numerics clause

2020-04-08 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/bits/slice_array.h (operator==(const slice&, const slice&)): Define for C++20. * include/std/complex (operator==(const T&, const complex&)) (operator!=(const complex&, const

[committed] libstdc++: Add comparison operators to result types

2020-04-08 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/std/charconv (to_chars_result, from_chars_result): Add defaulted equality comparisons for C++20. * testsuite/20_util/from_chars/compare.cc: New test. *

[committed] libstdc++: Add comparison operators to std::unique_ptr

2020-04-09 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". This includes the proposed resolution for LWG 3426 to fix the three-way comparison with nullptr_t. The existing tests for unique_ptr comparisons don't actually check the results, only that the expressions compile and are

Re: [PATCH] c++: make __is_constructible work with paren-init of aggrs [PR94149]

2020-04-09 Thread Jonathan Wakely via Gcc-patches
On 09/04/20 17:00 -0400, Marek Polacek wrote: In C++20 this is well-formed: using T = int[2]; T t(1, 2); which means that std::is_constructible_v should be true. But constructible_expr immediately returned the error_mark_node when it saw a list with more than one element. To give accurate

[committed] libstdc++: Implement LWG 3324 for [cmp.alg] function objects (LWG 3324)

2020-04-09 Thread Jonathan Wakely via Gcc-patches
LWG 3324 changed the [cmp.alg] types to use std::compare_three_way instead of the <=> operator, but we were still using the old specification. In order to make the existing tests pass the N::X type needs to be equality comparable, so that three_way_comparable is satisfied and compare_three_way can

Re: [PATCH] Allow new/delete operator deletion only for replaceable.

2020-04-10 Thread Jonathan Wakely via Gcc-patches
On Fri, 10 Apr 2020 at 09:08, Martin Liška wrote: > Marc pointed out that some targets do not use the leading '_' (or use 2 > dashes?) for mangled named? Double underscore at the start. I think darwin uses that.

Re: [PATCH] Allow new/delete operator deletion only for replaceable.

2020-04-09 Thread Jonathan Wakely via Gcc-patches
On Thu, 9 Apr 2020 at 09:05, Marc Glisse wrote: > Note that the matching is not 1-to-1. Array vs non-array and > aligned vs non-aligned seem important, but sized and unsized delete can > both match the same new, IIUC. Right. > Not sure about the nothrow versions... This is valid, and mixes the

[committed] libstdc++: Add comparison operators to std::shared_ptr (PR 94562)

2020-04-14 Thread Jonathan Wakely via Gcc-patches
This also implements the proposed resolution to LWG issue 3247, so that the ill-formed <=> expression with nullptr is not used. PR libstdc++/94562 * include/bits/shared_ptr.h (operator<=>): Define for C++20. * include/bits/shared_ptr_base.h (operator<=>): Likewise.

[committed] libstdc++: Fix constraints on std::compare_three_way

2020-04-14 Thread Jonathan Wakely via Gcc-patches
My "simplification" of std::compare_three_way's constraints in commit f214ffb336d582a66149068a2a96b7fcf395b5de was incorrect, because std::three_way_comparable_with imposes additional restrictions beyond the <=> expression being valid. * libsupc++/compare (compare_three_way): Fix

[committed] libstdc++: Add comparison operators to types from Utilities clause

2020-04-15 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". This removes all redundant equality and inequality operators in the Utilities clause, as they can be synthesized from the remaining equality operators. It also removes the single redundant operator in the Localization clause,

[committed] libstdc++: Add spaceship operator to std::type_index

2020-04-15 Thread Jonathan Wakely via Gcc-patches
Another C++20 change from P1614R2, "The Mothership has Landed". * include/std/typeindex (operator<=>): Define for C++20. * testsuite/20_util/typeindex/comparison_operators_c++20.cc: New test. Tested powerpc64le-linux, committed to master. commit

[committed] libstdc++: Add comparison operators to std::filesystem types

2020-04-15 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/bits/fs_dir.h (file_status): Define operator== for C++20. (directory_entry): Define operator<=> and remove redundant comparison operators for C++20. * include/bits/fs_fwd.h (space_info):

[committed] libstdc++: Add comparison operators for string and regex types

2020-04-17 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". This adds three-way comparison support to std::char_traits, std::basic_string, std::basic_string_view, and std::sub_match. * include/bits/basic_string.h (basic_string): Define operator<=> and remove redundant

[committed] libstdc++: Add comparison operators to sequence containers

2020-04-17 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". This implements <=> for sequence containers (and the __normal_iterator and _Pointer_adapter class templates). * include/bits/forward_list.h (forward_list): Define operator<=> and remove redundant comparison

[committed] libstdc++: Add comparison operators to types

2020-04-17 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/std/chrono (duration, time_point): Define operator<=> and remove redundant operator!= for C++20. * testsuite/20_util/duration/comparison_operators/three_way.cc: New test. *

[committed] libstdc++: Fix testsuite utility's use of allocators

2020-04-17 Thread Jonathan Wakely via Gcc-patches
In C++20 the rebind and const_reference members of std::allocator are gone, so this testsuite utility stopped working, causing ext/pb_ds/regression/priority_queue_rand_debug.cc to FAIL. * testsuite/util/native_type/native_priority_queue.hpp: Use allocator_traits to rebind

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Apr 2020 at 12:57, Richard Biener wrote: > > On Tue, Apr 7, 2020 at 1:46 PM Jonathan Wakely wrote: > > > > On Tue, 7 Apr 2020 at 12:40, Richard Biener > > wrote: > > > > > > On Tue, Apr 7, 2020 at 1:30 PM Jonathan Wakely > > > wrote: > > > > > > > > On Mon, 6 Apr 2020 at 13:45,

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Apr 2020 at 12:40, Richard Biener wrote: > > On Tue, Apr 7, 2020 at 1:30 PM Jonathan Wakely wrote: > > > > On Mon, 6 Apr 2020 at 13:45, Nathan Sidwell wrote: > > > The both operator new and operator delete are looked up in the same > > > manner. The std does not require a 'matching

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Jonathan Wakely via Gcc-patches
On Mon, 6 Apr 2020 at 13:45, Nathan Sidwell wrote: > The both operator new and operator delete are looked up in the same > manner. The std does not require a 'matching pair' be found. but it is > extremely poor form for a class to declare exactly one of operator > {new,delete}. There are

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Apr 2020 at 10:29, Richard Biener wrote: > > On Tue, Apr 7, 2020 at 10:26 AM Jonathan Wakely wrote: > > > > On Mon, 6 Apr 2020 at 13:45, Nathan Sidwell wrote: > > > > > > On 4/6/20 4:34 AM, Martin Liška wrote: > > > > > > > > > > > May I please ping Jason, Nathan and Jonathan who can

[committed] libstdc++: Restore ability to use in C++14 (PR 94520)

2020-04-07 Thread Jonathan Wakely via Gcc-patches
This C++17 header is supported in C++14 as a GNU extension, but stopped working last year because I made it depend on an internal helper which is only defined for C++17 and up. PR libstdc++/94520 * include/std/charconv (__integer_to_chars_result_type)

[committed] libstdc++: Make string_view::copy usable in constant expressions (PR 94498)

2020-04-06 Thread Jonathan Wakely via Gcc-patches
PR libstdc++/94498 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Make it usable in constant expressions for C++20. (__gnu_cxx::char_traits::copy, __gnu_cxx::char_traits::assign): Add _GLIBCXX20_CONSTEXPR. (std::char_traits,

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Apr 2020 at 08:35, Richard Biener wrote: > Ah, so __builtin_operator_new isn't a function but an alternate > new expression syntax? No, not a new-expression, because a new-expression calls operator new to obtain storage *and* begins the lifetime of one or more objects in that storage.

[wwwdocs] Fix inverted option for disabling new feature (PR 94581)

2020-04-14 Thread Jonathan Wakely via Gcc-patches
Committed as obvious. Thomas, please fix it if this isn't what you meant to say. commit 5264b357a424a38ccdcd3af01d67902109218aa8 Author: Jonathan Wakely Date: Tue Apr 14 11:09:43 2020 +0100 Fix inverted option for disabling new feature (PR 94581) diff --git a/htdocs/gcc-10/changes.html

[committed] libstdc++: Make comparison category comparisons noexcept (PR 94565)

2020-04-14 Thread Jonathan Wakely via Gcc-patches
PR libstdc++/94565 * libsupc++/compare (__unspec): Add noexcept-specifier to constructor. * testsuite/18_support/comparisons/categories/94565.cc: New test. Tested powerp64le-linux, committed to master. commit 597601aa7a0f822816041d521fae7da6e883fa7d Author: Jonathan

[committed] libstdc++: Add comparison operators to associative containers

2020-04-20 Thread Jonathan Wakely via Gcc-patches
The last C++20 changes from P1614R2, "The Mothership has Landed" * include/bits/stl_map.h (map): Define operator<=> and remove operator< for C++20. * include/bits/stl_multimap.h (multimap): Likewise. * include/bits/stl_multiset.h (multiset): Likewise. *

[committed] libstdc++: Update __cpp_lib_three_way_comparison macro

2020-04-20 Thread Jonathan Wakely via Gcc-patches
With P1614R2 fully implemented (except for the types which we don't support at all) we can define the feature test macro to the new value. * include/std/version (__cpp_lib_three_way_comparison): Update value. * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise. Tested

[committed] libstdc++: Add test for using istreambuf_iterator with sentinel

2020-04-20 Thread Jonathan Wakely via Gcc-patches
This test was supposed to be added two months ago as part of commit 120e873484f20d9a0b8400e2e464ac5b2088a747 but was omitted by mistake. * testsuite/24_iterators/istreambuf_iterator/sentinel.cc: New test. Tested x86_64-linux, committed to master. commit

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

2020-04-20 Thread Jonathan Wakely via Gcc-patches
* testsuite/20_util/is_constructible/51185.cc: Make test class a non-aggregate so that the test verifies the same thing in all -std modes. * testsuite/20_util/is_constructible/value-2.cc: Adjust expected results for some types when paren-init for aggregates

Re: [PATCH] c++: make __is_constructible work with paren-init of aggrs [PR94149]

2020-04-21 Thread Jonathan Wakely via Gcc-patches
On 09/04/20 17:00 -0400, Marek Polacek wrote: In C++20 this is well-formed: using T = int[2]; T t(1, 2); which means that std::is_constructible_v should be true. But constructible_expr immediately returned the error_mark_node when it saw a list with more than one element. To give accurate

[committed] libstdc++: Fix redundant assignment (PR 94629)

2020-04-19 Thread Jonathan Wakely via Gcc-patches
This appears to be a copy error, which cppcheck diagnoses. PR other/94629 * include/debug/formatter.h (_Error_formatter::_Parameter): Fix redundant assignment in constructor. Tested powerpc64le-linux, committed to master. commit a2c0fa35d0dc8912b0c1a658234221de61e60840

[committed] libstdc++: Remove operator!= overloads for unordered containers

2020-04-19 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/bits/unordered_map.h (unordered_map, unordered_multimap): Remove redundant operator!= for C++20. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Likewise. *

[committed] libstdc++: Define operator<=> for std::stack and std::queue

2020-04-19 Thread Jonathan Wakely via Gcc-patches
Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/bits/stl_queue.h (queue): Define operator<=> for C++20. * include/bits/stl_stack.h (stack): Likewise. * testsuite/23_containers/queue/cmp_c++20.cc: New test. *

Re: [PATCH] libstdc++: don't use #include_next in c_global headers

2020-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/20 07:01 +0200, Helmut Grohne wrote: The and headers need their counter parts and from the libc respectively, but libstdc++ wraps these headers. Now and include these headers using $ echo '#include ' | g++ -x c++ -E - -isystem /usr/include >/dev/null In file included from :1:

Re: [PATCH] Avoid illegal argument to verbose in dg-test callback

2020-04-20 Thread Jonathan Wakely via Gcc-patches
On 16/04/20 15:21 +0200, Matthias Kretz wrote: From: Matthias Kretz If extra_tool_flags starts with a dash, an error like 'ERROR: verbose: illegal argument: -march=native -O2 -std=c++17' is printed. This is easily fixed by inserting a double dash before the variable. *

[committed] libstdc++: Fix -Wunused-parameter warning in test

2020-04-16 Thread Jonathan Wakely via Gcc-patches
* testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Remove name of unused parameter. Not an important change, just a tiny clean-up. Tested x86_64-linux and committed to master. commit c8d88bf26e4c4c0eeddbf6a9dc184f28d4ef85e4 Author: Jonathan Wakely Date: Thu Apr 16

Re: [PATCH] Allow new/delete operator deletion only for replaceable.

2020-04-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Apr 2020 at 08:05, Jakub Jelinek wrote: > One needs to use check-c++-all or GXX_TESTSUITE_STDS=98,11,14,17,2a make check > or similar to get that though, because 11 isn't tested by default, only 98, > 14 and 17 are ATM I think. Right. > Fixed thusly, committed to trunk as obvious.

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Jonathan Wakely via Gcc-patches
On Mon, 6 Apr 2020 at 13:45, Nathan Sidwell wrote: > > On 4/6/20 4:34 AM, Martin Liška wrote: > > > > > May I please ping Jason, Nathan and Jonathan who can help us here? > > On IRC Martin clarified the question as essentially 'how do you pair up > operator new and operator delete calls?' (so you

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. *

[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

[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:

[committed] libstdc++: Fix std::to_address for debug iterators (PR 93960)

2020-04-03 Thread Jonathan Wakely via Gcc-patches
It should be valid to use std::to_address on a past-the-end iterator, but the debug mode iterators do a check for dereferenceable in their operator->(). That check is generally useful, so rather than remove it this changes std::__to_address to identify a debug mode iterator and use

Re: [committed] libstdc++: Move "free books" list from fsf.org to gnu.org

2020-04-03 Thread Jonathan Wakely via Gcc-patches
On 01/04/20 22:47 +0200, Gerald Pfeifer wrote: The fsf.org server now has a redirect to the gnu.org server; let's follow that. This is my first commit to libstdc++ using git, my first squashing (since I had a follow tweak to the ChangeLog), and my first --amend. Please advise if I can/should

[committed 1/3] libstdc++: Implement C++20 changes to insert iterators

2020-03-27 Thread Jonathan Wakely via Gcc-patches
std::insert_iterator and std::inserter need to be adjusted for C++20, so that they use ranges::iterator_t. That alias template requires ranges::begin to be defined. Rather than moving the whole of ranges::begin (and related details like ranges::enable_borrowed_range) into , this defines a new,

[committed 2/3] libstdc++: Add remaining C++20 changes to iterator adaptors

2020-03-27 Thread Jonathan Wakely via Gcc-patches
This adds the missing parts of P0896R4 to reverse_iterator and move_iterator, so that they meet the C++20 requirements. This should be the last piece of P0896R4, meaning ranges support is now complete. The PR 94354 bug with reverse_iterator's comparisons is fixed for C++20 only, but that change

[committed 3/3] libstdc++: Define __cpp_lib_ranges macro for C++20

2020-03-27 Thread Jonathan Wakely via Gcc-patches
Define the feature test macro now that ranges support is complete. This also changes the preprocessor checks for the __cpp_concepts macro so that library components depending on concepts are only enabled when C++20 concepts are supported, and not just for the Concepts TS (which uses different

Re: [committed 2/3] libstdc++: Add remaining C++20 changes to iterator adaptors

2020-03-27 Thread Jonathan Wakely via Gcc-patches
On 27/03/20 23:29 +, Jonathan Wakely wrote: @@ -403,6 +428,49 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator>=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return !(__x < __y); } +#else // C++20 + template +constexpr auto +

[committed] libstdc++: Move definition earlier in file

2020-03-27 Thread Jonathan Wakely via Gcc-patches
This moves __is_array_convertible so it's not between __is_nothrow_convertible and its helper, since it isn't related to those. * include/std/type_traits (__is_array_convertible): Move definition to immediately after is_convertible. Tested powerpc64le-linux, committed to master.

Re: [committed 2/3] libstdc++: Add remaining C++20 changes to iterator adaptors

2020-03-28 Thread Jonathan Wakely via Gcc-patches
On 28/03/20 00:16 +, Jonathan Wakely wrote: On 27/03/20 23:29 +, Jonathan Wakely wrote: @@ -403,6 +428,49 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator>=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return !(__x < __y); } +#else

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

2020-03-28 Thread Jonathan Wakely via Gcc-patches
* testsuite/20_util/is_constructible/value-2.cc: Fix test to account for changes due to parenthesized aggregate-initialization in C++20. * testsuite/20_util/time_point/cons/81468.cc: Fix test to not clash with std::chrono::sys_time in C++20. Tested

Re: [PATCH]libstdc++-v3/test: Skip "use_service.cc" for aarch64 baremetal

2020-04-01 Thread Jonathan Wakely via Gcc-patches
On 01/04/20 16:56 +0100, Jonathan Wakely wrote: On 01/04/20 17:28 +0200, Andrea Corallo wrote: Hi all, "use_service.cc" libstdc++ test does not compile for baremetal, unfortunately AFAIK we don't have an appropriate selector to skip these. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89760

Re: [PATCH]libstdc++-v3/test: Skip "use_service.cc" for aarch64 baremetal

2020-04-01 Thread Jonathan Wakely via Gcc-patches
On 01/04/20 17:28 +0200, Andrea Corallo wrote: Hi all, "use_service.cc" libstdc++ test does not compile for baremetal, unfortunately AFAIK we don't have an appropriate selector to skip these. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89760

Re: [PATCH]libstdc++-v3/test: Skip "use_service.cc" for aarch64 baremetal

2020-04-02 Thread Jonathan Wakely via Gcc-patches
On 02/04/20 10:44 +0200, Andrea Corallo wrote: Jonathan Wakely writes: On 01/04/20 16:56 +0100, Jonathan Wakely wrote: Does that help, or does it still fail for other reasons? Yes it does thanks! Updated patch follows. Okay for trunk? OK, thanks.

[committed] libstdc++: Add some C++20 additions to

2020-03-26 Thread Jonathan Wakely via Gcc-patches
* include/std/chrono (chrono::days, chrono::weeks, chrono::years) (chrono::months, chrono::sys_days, chrono::local_t) (chrono::local_time, chrono::local_seconds, chrono::local_days): Define for C++20. (chrono::time_point): Add missing static assert.

Re: [PATCH] coroutines: Fix handling of non-class coroutine returns [PR94759]

2020-04-25 Thread Jonathan Wakely via Gcc-patches
On 25/04/20 14:49 +0100, Iain Sandoe wrote: Hi From the standard: The header defines the primary template coroutine_traits such that if ArgTypes is a parameter pack of types and if the qualified-id R::promise_type is valid and denotes a type, then coroutine_traits has the following publicly

Re: [PATCH] libstdc++: Fix subrange::advance and subrange::prev (LWG 3433)

2020-04-28 Thread Jonathan Wakely via Gcc-patches
On 27/04/20 17:34 -0400, Patrick Palka via Libstdc++ wrote: This implements the proposed resolution of LWG 3433, which fixes subrange::advance when called with a negative argument. Tested on x86_64-pc-linux-gnu, does this look OK to commit? libstdc++-v3/ChangeLog: LWG 3433

Re: [PATCH] c++, middle-end, rs6000: Fix C++17 ABI incompatibilities during class layout [PR94707]

2020-04-27 Thread Jonathan Wakely via Gcc-patches
On 27/04/20 21:47 +0200, Jakub Jelinek wrote: On Mon, Apr 27, 2020 at 03:32:29PM -0400, Jason Merrill wrote: Note that C++20 adds empty non-static data members with the [[no_unique_address]] attribute. How will that fit into these ABIs and the others that had issues with parameter passing?

[committed 10/8] libstdc++: Fixes for feature test macros (PR 91480)

2020-04-28 Thread Jonathan Wakely via Gcc-patches
Remove the non-standard __cpp_lib_allocator_is_always_equal macro and add the missing macros for P1032R1. PR libstdc++/91480 * include/bits/allocator.h (__cpp_lib_allocator_is_always_equal): Remove non-standard macro. * include/bits/stl_iterator.h

Re: [PATCH] middle-end, rs6000: Handle empty [[no_unique_address]] fields like empty bases on powerpc64le-linux [PR94707]

2020-04-28 Thread Jonathan Wakely via Gcc-patches
On 28/04/20 19:11 +0200, Jakub Jelinek wrote: On Tue, Apr 28, 2020 at 12:01:15PM -0500, Segher Boessenkool wrote: So the attribute says an object of this struct can have the same address as another object of this struct. But that is not what the backend code uses it for! There is a FAQ at

[committed] libstdc++: Fix regression in std::_Construct (PR 94831)

2020-04-28 Thread Jonathan Wakely via Gcc-patches
By trying to reuse the existing std::_Construct function as a wrapper for std::construct_at I introduced regressions, because changing std::_Construct to return non-void made it ill-formed for array types. The solution is to revert _Construct to its former state, and change

Re: [PATCH][libstd++][PR92156]

2020-04-23 Thread Jonathan Wakely via Gcc-patches
On 21/04/20 20:58 +0530, kamlesh kumar via Libstdc++ wrote: added VERIFY in test and changed the template parameter naming. diff --git a/libstdc++-v3/include/std/any b/libstdc++-v3/include/std/any index 6b7e68f0e63..d350d0b2575 100644 --- a/libstdc++-v3/include/std/any +++

Re: [PATCH][libstd++][PR92156]

2020-04-23 Thread Jonathan Wakely via Gcc-patches
On 24/04/20 00:20 +0100, Jonathan Wakely wrote: On 21/04/20 20:58 +0530, kamlesh kumar via Libstdc++ wrote: added VERIFY in test and changed the template parameter naming. diff --git a/libstdc++-v3/include/std/any b/libstdc++-v3/include/std/any index 6b7e68f0e63..d350d0b2575 100644 ---

Re: [wwwdocs] Remove form for (un)subscribing from old mailing lists

2020-04-24 Thread Jonathan Wakely via Gcc-patches
On 24/04/20 12:57 +0200, Gerald Pfeifer wrote: On Thu, 23 Apr 2020, Jonathan Wakely wrote: This no longer works, so direct people to the mailman listinfo pages instead. OK to commit to wwwdocs? Yes, thank you! I was wondering whether we could keep something similar to this nice form, but

Re: [wwwdocs] Remove form for (un)subscribing from old mailing lists

2020-04-24 Thread Jonathan Wakely via Gcc-patches
On 24/04/20 12:17 +0100, Jonathan Wakely wrote: On 24/04/20 12:57 +0200, Gerald Pfeifer wrote: On Thu, 23 Apr 2020, Jonathan Wakely wrote: This no longer works, so direct people to the mailman listinfo pages instead. OK to commit to wwwdocs? Yes, thank you! I was wondering whether we could

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

2020-04-24 Thread Jonathan Wakely via Gcc-patches
On 16/03/20 22:54 +, Jonathan Wakely 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 means has no usable constructors. This may be a defect in the TS. This patch fixes it by

Re: [PATCH] libstdc++: don't use #include_next in c_global headers

2020-04-24 Thread Jonathan Wakely via Gcc-patches
On 23/04/20 09:23 +0100, Jonathan Wakely wrote: On 23/04/20 06:32 +0200, Helmut Grohne wrote: Hi, On Mon, Apr 20, 2020 at 10:12:37AM +0100, Jonathan Wakely wrote: Now you are probably going to say that "-isystem /usr/include" is a bad idea and that you shouldn't do that. Right. I'm

[committed] libstdc++: Improve C++14 and C++17 status docs

2020-04-21 Thread Jonathan Wakely via Gcc-patches
This adds a full table of contents for the C++14 and C++17 standards, with status for each part. For C++14 the list of proposals is removed, as it adds little value now that everything is supported. For C++17 the table of proposals is retained, because it documents he feature test macros for the

[committed] libstdc++: Fix __normal_iterator comparisons for C++20

2020-04-21 Thread Jonathan Wakely via Gcc-patches
This fixes a regression introduced when I replaced __normal_iterator's relational operators with operator<=>. If the wrapped iterator type doesn't define operator<=> then __normal_iterator doesdn't either, which breaks any use of fancy pointers that don't define <=>. The regression was found when

[committed 8/8] libstdc++: Define __cpp_lib_execution feature test macro

2020-04-22 Thread Jonathan Wakely via Gcc-patches
This macro has never been defined by libstdc++, despite supporting the parallel algorithms. It should have a different value for C++17 and C++20, because P1001R2 should not be supported in C++17, but unsequenced_policy is defined for C++17 (see PR p4702). * include/std/execution

[PATCH] c++: Fix misuse of "override" in -Weffc++ warnings (PR 94698)

2020-04-22 Thread Jonathan Wakely via Gcc-patches
These warnings have nothing to do with virtual functions, so "override" is inappropriate. The warnings are just talking about defining special members, so let's say that. PR translation/94698 * class.c (check_field_decls): Change "override" to "define" in -Weffc++

Re: [PATCH] c++: Fix misuse of "override" in -Weffc++ warnings (PR 94698)

2020-04-22 Thread Jonathan Wakely via Gcc-patches
On 22/04/20 20:43 +0100, Jonathan Wakely wrote: On 22/04/20 15:33 -0400, Jason Merrill wrote: On Wed, Apr 22, 2020 at 3:31 PM Jonathan Wakely wrote: On 22/04/20 15:19 -0400, Jason Merrill wrote: On 4/22/20 2:37 AM, Jonathan Wakely wrote: These warnings have nothing to do with virtual

[wwwdocs] Update list of new C++20 features in libstdc++

2020-04-21 Thread Jonathan Wakely via Gcc-patches
Committed to wwwdocs. commit ba9d172720e36f93daf9c1b4569d4babe34e307e Author: Jonathan Wakely Date: Tue Apr 21 20:28:48 2020 +0100 Update list of new C++20 features in libstdc++ diff --git a/htdocs/gcc-10/changes.html b/htdocs/gcc-10/changes.html index fc8f16e7..06a4267a 100644 ---

[committed] libstdc++: Improve tests for __cpp_lib_erase_if macro

2020-04-22 Thread Jonathan Wakely via Gcc-patches
* testsuite/21_strings/basic_string/erasure.cc: Check for updated value of __cpp_lib_erase_if. * testsuite/23_containers/deque/erasure.cc: Likewise. * testsuite/23_containers/forward_list/erasure.cc: Likewise. * testsuite/23_containers/list/erasure.cc:

Re: [PATCH] libstdc++: don't use #include_next in c_global headers

2020-04-23 Thread Jonathan Wakely via Gcc-patches
On 23/04/20 06:32 +0200, Helmut Grohne wrote: Hi, On Mon, Apr 20, 2020 at 10:12:37AM +0100, Jonathan Wakely wrote: > Now you are probably going to say that "-isystem /usr/include" is a bad > idea and that you shouldn't do that. Right. > I'm inclined to agree. This isn't a > problem just yet.

Re: [PATCH] diagnostics: Add %{...%} pretty-format support for URLs and use it in -Wpsabi diagnostcs

2020-04-29 Thread Jonathan Wakely via Gcc-patches
On 29/04/20 09:24 -0400, David Malcolm wrote: On Wed, 2020-04-29 at 14:46 +0200, Jakub Jelinek wrote: @@ -6416,6 +6416,8 @@ aapcs_vfp_is_call_or_return_candidate (e && ((alt = aapcs_vfp_sub_candidate (type, _mode, NULL)) != ag_count)) { +

[committed] libstdc++: Fix outdated comment about std::string instantiations (PR 94854)

2020-04-29 Thread Jonathan Wakely via Gcc-patches
PR libstdc++/94854 * include/bits/basic_string.tcc: Update comment about explicit instantiations. Committed to master as obvious. Backports to follow. commit 8f1591763fd50b143af0dc1770741f326a97583a Author: Jonathan Wakely Date: Wed Apr 29 18:57:34 2020 +0100

[wwwdocs] Improve ugly formatting for std::atomic

2020-04-30 Thread Jonathan Wakely via Gcc-patches
This looks much nicer for me, because the font for the part is much smaller than the other text. Committed to wwwdocs. commit 3f573b5fe7df858a27b0275edc5fd4386804ae83 Author: Jonathan Wakely Date: Thu Apr 30 20:54:09 2020 +0100 Improve ugly formatting for std::atomic diff --git

[PATCH] libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
The deduced return type causes the instantiation of the function body, which can then require the instantiation of std::projected::operator* which is intentionally not defined. This patch uses a helper trait to define the return type, so that the function body doesn't need to be instantiated.

Re: [PATCH] libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
On 01/05/20 14:28 +0100, Jonathan Wakely wrote: On 01/05/20 13:03 +0100, Jonathan Wakely wrote: The deduced return type causes the instantiation of the function body, which can then require the instantiation of std::projected::operator* which is intentionally not defined. This patch uses a

Re: [committed] libstdc++: Replace reserved identifier _T with _Tp (PR 94901)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
On 01/05/20 14:45 +0100, Jonathan Wakely wrote: On 01/05/20 15:21 +0200, Jakub Jelinek via Libstdc++ wrote: On Fri, May 01, 2020 at 02:17:54PM +0100, Jonathan Wakely via Gcc-patches wrote: The libstdc++ manual documents that _T can not be used, because it's a macro in system headers on some

[committed] libstdc++: Replace reserved identifier _T with _Tp (PR 94901)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
The libstdc++ manual documents that _T can not be used, because it's a macro in system headers on some targets. PR libstdc++/94901 * include/std/type_traits (__is_complete_or_unbounded): Replace BADNAME _T with _Tp. * testsuite/17_intro/badnames.cc: New test.

Re: [committed] libstdc++: Replace reserved identifier _T with _Tp (PR 94901)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
On 01/05/20 15:21 +0200, Jakub Jelinek via Libstdc++ wrote: On Fri, May 01, 2020 at 02:17:54PM +0100, Jonathan Wakely via Gcc-patches wrote: The libstdc++ manual documents that _T can not be used, because it's a macro in system headers on some targets. PR libstdc++/94901

Re: [PATCH] libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)

2020-05-01 Thread Jonathan Wakely via Gcc-patches
On 01/05/20 13:03 +0100, Jonathan Wakely wrote: The deduced return type causes the instantiation of the function body, which can then require the instantiation of std::projected::operator* which is intentionally not defined. This patch uses a helper trait to define the return type, so that the

[committed] diagnostics: Fix spelling in comment

2020-04-30 Thread Jonathan Wakely via Gcc-patches
gcc/ChangeLog: * pretty-print.c (pp_take_prefix): Fix spelling in comment. Committed to master as obvious. commit 04e88369a7d95492efccf8f527d27cca74664ea7 Author: Jonathan Wakely Date: Thu Apr 30 14:42:24 2020 +0100 diagnostics: Fix spelling in comment gcc/ChangeLog:

[committed] libstdc++: Avoid errors in allocator's noexcept-specifier (PR 89510)

2020-04-30 Thread Jonathan Wakely via Gcc-patches
This fixes a regression due to the conditional noexcept-specifier on std::allocator::construct and std::allocator::destroy, as well as the corresponding members of new_allocator, malloc_allocator, and allocator_traits. Those noexcept-specifiers were using expressions which might be ill-formed,

[committed] libstdc++: Make pmr::synchronized_pool_resource work without libpthread (PR 94936)

2020-05-04 Thread Jonathan Wakely via Gcc-patches
I implicitly assumed that programs using pmr::synchronized_pool_resource would also be using multiple threads, and so the weak symbols in gthr-posix.h would be resolved by linking to libpthread. If that isn't true then it crashes when trying to use pthread_key_create. This commit makes the pool

[committed] libstdc++: Fix broken link to SGI STL FAQ

2020-05-04 Thread Jonathan Wakely via Gcc-patches
The previous URL to an entry in the wayback machine now redirects to a page saying "SGI.com Tech Archive Resources now retired" so use an older entry from the archive. * doc/xml/faq.xml: Use working link for SGI STL FAQ. * doc/html/*: Regenerate. Committed to master, I'll

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

2020-05-04 Thread Jonathan Wakely via Gcc-patches
On 12/03/20 10:13 +, Jonathan Wakely via Libstdc++ wrote: 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

[committed] libstdc++: Fix incorrect size calculation in PMR resource (PR 94906)

2020-05-04 Thread Jonathan Wakely via Gcc-patches
Calculating the size of a chunk being returned to the upstream allocator was done with a 32-bit type, so it wrapped if the chunk was 4GB or larger. I don't know how to test this without allocating 4GB, so there's no test in the testsuite. It has been tested manually with allocations sizes and

  1   2   3   4   5   6   7   8   9   10   >