[committed] libstdc++: Add std::__conditional_t alias template

2021-10-01 Thread Jonathan Wakely via Gcc-patches
This change is inspired by the suggestion in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1715r0.html The new std::__conditional_t alias template is functionally equivalent to std::conditional_t but should be more efficient to compile, due to only ever instantiating two specializations

[committed] libstdc++: Avoid unconditional use of errc::not_supported [PR 99327]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
The errc::not_supported constant is only defined if ENOTSUP is defined, which is not true for all targets. Many uses of errc::not_supported in the filesystem library do not actually match the intended meaning of ENOTSUP described by POSIX. They should be using ENOSYS instead (i.e. errc::function_no

[committed] libstdc++: Fix narrowing conversion in std::visit

2021-10-01 Thread Jonathan Wakely via Gcc-patches
Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/variant (__do_visit): Use variant_npos instead of literal -1 that requires a narrowing conversion. Tested powerpc64le-linux. Committed to trunk. commit dc1b29508d765b874372f4b1737ac6dc86962506 Author: Jonathan

[committed] libstdc++: Simplify __throw_out_of_range_fmt for freestanding

2021-10-01 Thread Jonathan Wakely via Gcc-patches
There is no point expanding the format string if we're just going to abort instead of throw an exception. And for freestanding or non-verbose builds we shouldn't do it either, to reduce the binary size. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * src/c++11/functexcept.cc (_

[committed] libstdc++: Remove useless base classes in pb_db tests

2021-10-01 Thread Jonathan Wakely via Gcc-patches
These function objects do not need to be adaptable, so stop deriving from deprecated classes. Also the 'inline' keyword is redundant on member functions defined in the class body. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/ext/pb_ds/example/basic_multimap.cc: Rem

[committed] libstdc++: Remove unary_function base classes from std::thread tests

2021-10-01 Thread Jonathan Wakely via Gcc-patches
std::thread does not care if a function object is adaptable, so there is no need to derive from the deprecated std::unary_function class in these tests. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/30_threads/thread/cons/3.cc: Remove derivation from std::un

[committed] libstdc++: Implement LWG 3392 for std::ranges::distance

2021-10-01 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/ranges_base.h (ranges::distance): Split overload into two (LWG 3392). * testsuite/24_iterators/range_operations/lwg3392.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit 20751fad19e1b0fb4272309dd6d7fde182b08dc1 Autho

[committed] libstdc++: Implement LWG 3522 for std::priority_queue

2021-10-01 Thread Jonathan Wakely via Gcc-patches
The LWG 3522 issue constrains all constructors of container adaptors that have InputIterator parameters. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_queue.h (priority_queue): Constrain constructors with InputIterator parameters (LWG 3522). *

[committed] libstdc++: Implement LWG 3529 for std::priority_queue

2021-10-01 Thread Jonathan Wakely via Gcc-patches
The LWG 3529 issue changes to use two overloads instead of one with a default argument, so that the sequence can be initialized directly with the iterator range when no sequence argument is provided. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_queue.h (prio

[committed] libstdc++: Implement LWG 3506 for std::priority_queue

2021-10-01 Thread Jonathan Wakely via Gcc-patches
The LWG 3506 issue ads allocator-extended versions of the constructors that take iterator arguments. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_queue.h (priority_queue): Add allocator-extended overloads for constructors taking iterator. * t

[committed] libstdc++: Add container adaptor constructors taking iterators (P1425R4)

2021-10-01 Thread Jonathan Wakely via Gcc-patches
This adds a feature that was recently added to the C++23 working draft. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_queue.h (__cpp_lib_adaptor_iterator_pair_constructor): Define for C++23, as per P1425R4. (queue(InputIterator, InputI

[committed] libstdc++: Make std::jthread support pointers to member functions [PR 100612]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
This adds a non-standard extension to support initializing a std::jthread with a pointer to a member function that expects a stop_token to be added to the arguments. That use case is not supported by C++20, because the stop_token would get added as the first argument, which is where the object argu

[committed] libstdc++: Allow stateful allocators in std::list::sort [PR 66742]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
The temporary lists used by std::list::sort are default constructed, which means they use default constructed allocators. The sort operation is defined in terms of merge and splice operations, which have undefined behaviour (and abort) if the allocators do not compare equal. This means it is not po

Re: [PATCH] c++: Suppress error when cv-qualified reference is introduced by typedef [PR101783]

2021-10-01 Thread Nick Huang via Gcc-patches
> ...the subject line for the commit should be the first line of the > commit message, followed by a blank line, followed by the description of > the patch; without the subject line, git format-patch thought your whole > description was the subject of the patch. oh, I didn't realize this without

[PATCH] c++: ttp variadic constraint subsumption [PR99904]

2021-10-01 Thread Patrick Palka via Gcc-patches
Here we're crashing when level-lowering the variadic constraints on the template template parameter TT because tsubst_pack_expansion expects processing_template_decl to be set during a partial substitution. bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/11? Also te

[PATCH] c-family: Implement -Warray-compare [PR97573]

2021-10-01 Thread Marek Polacek via Gcc-patches
This patch addresses one of my leftovers from GCC 11. C++20 introduced [depr.array.comp]: "Equality and relational comparisons between two operands of array type are deprecated." so this patch adds -Warray-compare. Since the code in question is dubious (the comparison doesn't actually compare the

Re: [PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573]

2021-10-01 Thread Marek Polacek via Gcc-patches
On Fri, Oct 01, 2021 at 09:30:41AM -0400, Jason Merrill wrote: > On 9/30/21 17:56, Marek Polacek wrote: > > On Thu, Sep 30, 2021 at 03:34:24PM -0400, Jason Merrill wrote: > > > On 9/30/21 10:50, Marek Polacek wrote: > > > > This patch addresses one of my leftovers from GCC 11. C++20 introduced > >

[committed] libstdc++: Restore printing of assertion messages [PR102100]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
My changes for PR 101429 broke the _-replacement_assert function, because we now always just abort without printing anything. That's because I added checks for _GLIBCXX_HOSTED and _GLIBCXX_VERBOSE, but the checks are done before those get defined. This adds a new macro which is set by the sed comm

Re: [committed] libstdc++: Make std::jthread support pointers to member functions [PR 100612]

2021-10-01 Thread Ville Voutilainen via Gcc-patches
On Fri, 1 Oct 2021 at 23:19, Jonathan Wakely via Libstdc++ wrote: > > This adds a non-standard extension to support initializing a > std::jthread with a pointer to a member function that expects a > stop_token to be added to the arguments. That use case is not supported > by C++20, because the sto

Re: [committed] libstdc++: Make std::jthread support pointers to member functions [PR 100612]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
On Fri, 1 Oct 2021 at 21:26, Ville Voutilainen wrote: > > On Fri, 1 Oct 2021 at 23:19, Jonathan Wakely via Libstdc++ > wrote: > > > > This adds a non-standard extension to support initializing a > > std::jthread with a pointer to a member function that expects a > > stop_token to be added to the a

[PATCH] c++: Do not warn about lifetime of std::initializer_list& [PR102482]

2021-10-01 Thread Jonathan Wakely via Gcc-patches
An initializer-list constructor taking a non-const lvalue cannot be called with a temporary, so the array's lifetime probably doesn't end with the full expression. -Winit-list-lifetime should not warn for that case. PR c++/102482 gcc/cp/ChangeLog: * init.c (maybe_warn_list_ctor):

Re: [PATCH] c-family: Implement -Warray-compare [PR97573]

2021-10-01 Thread Jakub Jelinek via Gcc-patches
On Fri, Oct 01, 2021 at 04:11:08PM -0400, Marek Polacek via Gcc-patches wrote: > + auto_diagnostic_group d; > + if (warning_at (location, OPT_Warray_compare, > + "comparison between two arrays%s", > + (c_dialect_cxx () && cxx_dialect >= cxx20) > + ? " is

[PATCH v6] Fix for powerpc64 long double complex divide failure

2021-10-01 Thread Patrick McGehearty via Gcc-patches
- - - - New in version 6: Due to an oversight (i.e. coding error), version 5 changed the use of __LIBGCC_TF_EPSILON__ to __LIBGCC_DF_EPSILON__ but not the other LIBGCC_TF values. For correct execution of the long double test case it is necessary to also switch to using __LIBGCC_DF_MIN__. For consi

RE: [PATCH][GCC] aarch64: enable cortex-a710 CPU

2021-10-01 Thread Przemyslaw Wirkus via Gcc-patches
> -Original Message- > From: Kyrylo Tkachov > Sent: 01 October 2021 13:16 > To: Przemyslaw Wirkus ; gcc- > patc...@gcc.gnu.org > Cc: Richard Earnshaw ; Richard Sandiford > ; Marcus Shawcroft > > Subject: RE: [PATCH][GCC] aarch64: enable cortex-a710 CPU > > > > > -Original Messag

RE: [PATCH][GCC] aarch64: enable cortex-a510 CPU

2021-10-01 Thread Przemyslaw Wirkus via Gcc-patches
> Hi Przemek, > > > -Original Message- > > From: Przemyslaw Wirkus > > Sent: Wednesday, September 22, 2021 9:35 AM > > To: gcc-patches@gcc.gnu.org > > Cc: Richard Earnshaw ; Richard Sandiford > > ; Marcus Shawcroft > > ; Kyrylo Tkachov > > > Subject: [PATCH][GCC] aarch64: enable cortex-a

RE: [PATCH][GCC] aarch64: enable cortex-x2 CPU

2021-10-01 Thread Przemyslaw Wirkus via Gcc-patches
> Subject: RE: [PATCH][GCC] aarch64: enable cortex-x2 CPU > > > > > -Original Message- > > From: Kyrylo Tkachov > > Sent: Friday, October 1, 2021 1:17 PM > > To: Przemyslaw Wirkus ; gcc- > > patc...@gcc.gnu.org > > Cc: Richard Earnshaw ; Richard Sandiford > > ; Marcus Shawcroft > > > >

Re: [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator>

2021-10-01 Thread Jonathan Wakely via Gcc-patches
On Thu, 30 Sept 2021 at 21:27, François Dumont via Libstdc++ wrote: > > Here is the _Safe_iterator one. > > Doing so I noticed that pointer_traits rebind for __normal_iterator was > wrong and added tests on it. Oops, thanks! > For _Safe_iterator maybe I should specialize only when instantiated w

Re: [PATCH] c-format: Add -Wformat-same-precision option [PR80060]

2021-10-01 Thread Daniil Stas via Gcc-patches
Hi, Martin On Thu, 30 Sep 2021 09:02:28 -0600 Martin Sebor wrote: > On 9/26/21 3:52 PM, Daniil Stas via Gcc-patches wrote: > > This option is enabled by default when -Wformat option is enabled. A > > user can specify -Wno-format-same-precision to disable emitting > > warnings about an argument p

[PATCH v2] c-family: Implement -Warray-compare [PR97573]

2021-10-01 Thread Marek Polacek via Gcc-patches
On Fri, Oct 01, 2021 at 11:15:45PM +0200, Jakub Jelinek wrote: > On Fri, Oct 01, 2021 at 04:11:08PM -0400, Marek Polacek via Gcc-patches wrote: > > + auto_diagnostic_group d; > > + if (warning_at (location, OPT_Warray_compare, > > + "comparison between two arrays%s", > > +

Re: [PATCH] c++: unifying equal NONTYPE_ARGUMENT_PACKs [PR102547]

2021-10-01 Thread Patrick Palka via Gcc-patches
On Fri, Oct 1, 2021 at 1:29 PM Patrick Palka wrote: > > On Fri, 1 Oct 2021, Jason Merrill wrote: > > > On 10/1/21 10:26, Patrick Palka wrote: > > > On Fri, 1 Oct 2021, Jason Merrill wrote: > > > > > > > On 10/1/21 09:46, Patrick Palka wrote: > > > > > Here during partial ordering of the two partia

Re: [PATCH] c++: unifying equal NONTYPE_ARGUMENT_PACKs [PR102547]

2021-10-01 Thread Patrick Palka via Gcc-patches
On Fri, 1 Oct 2021, Patrick Palka wrote: > On Fri, Oct 1, 2021 at 1:29 PM Patrick Palka wrote: > > > > On Fri, 1 Oct 2021, Jason Merrill wrote: > > > > > On 10/1/21 10:26, Patrick Palka wrote: > > > > On Fri, 1 Oct 2021, Jason Merrill wrote: > > > > > > > > > On 10/1/21 09:46, Patrick Palka wrote

[r12-4067 Regression] FAIL: g++.dg/modules/xtreme-header-3_a.H -std=c++2b (test for excess errors) on Linux/x86_64

2021-10-01 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, c46ecb0112e91c80ee111439e79a58a953e4479d is the first bad commit commit c46ecb0112e91c80ee111439e79a58a953e4479d Author: Jonathan Wakely Date: Mon Apr 19 14:49:12 2021 +0100 libstdc++: Allow visiting inherited variants [PR 90943] caused FAIL: g++.dg/modules/xtreme-header

[PATCH] Use unsigned long long in asm-x86-linux-rdmsr.c

2021-10-01 Thread H.J. Lu via Gcc-patches
On Wed, Aug 4, 2021 at 3:26 PM David Malcolm via Gcc-patches wrote: > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. > Pushed to trunk as r12-2749-gded2c2c068f6f2825474758cb03a05070a5837e8. > > gcc/ChangeLog: > PR analyzer/101570 > * Makefile.in (ANALYZER_OBJS): A

<    1   2