Re: [PATCH] c++: decltype of (non-captured variable) [PR83167]

2023-12-01 Thread Patrick Palka
On Fri, 1 Dec 2023, Jason Merrill wrote: > On 12/1/23 12:32, Patrick Palka wrote: > > On Tue, 14 Nov 2023, Jason Merrill wrote: > > > > > On 11/14/23 11:10, Patrick Palka wrote: > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for &

Re: [pushed] c++: remove LAMBDA_EXPR_MUTABLE_P

2023-12-01 Thread Patrick Palka
On Thu, 30 Nov 2023, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, applying to trunk. > > -- 8< -- > > In review of the deducing 'this' patch it came up that LAMBDA_EXPR_MUTABLE_P > doesn't make sense for a lambda with an explicit object parameter. And it > was never necessary, so let's

Re: [PATCH] c++: decltype of (non-captured variable) [PR83167]

2023-12-01 Thread Patrick Palka
On Tue, 14 Nov 2023, Jason Merrill wrote: > On 11/14/23 11:10, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk? > > > > -- >8 -- > > > > For decltype((x)) within a lambda where x

[PATCH] libstdc++: Simplify ranges::to closure objects

2023-11-30 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Use the existing _Partial range adaptor closure object in the definition of ranges::to instead of essentially open coding it. libstdc++-v3/ChangeLog: * include/std/ranges (__detail::_ToClosure): Replace with ...

Re: [PATCH v3 3/3] c++: note other candidates when diagnosing deletedness

2023-11-30 Thread Patrick Palka
On Fri, 27 Oct 2023, Patrick Palka wrote: > On Fri, 27 Oct 2023, Jason Merrill wrote: > > > On 10/27/23 15:55, Patrick Palka wrote: > > > With the previous two patches in place, we can now extend our > > > deletedness diagnostic to note the ot

Re: [PATCH] c++: partial spec constraint checking context [PR105220]

2023-11-30 Thread Patrick Palka
On Fri, 3 Nov 2023, Patrick Palka wrote: > On Tue, 3 May 2022, Jason Merrill wrote: > > > On 5/2/22 14:50, Patrick Palka wrote: > > > Currently when checking the constraints of a class template, we do so in > > > the context of the template, not the specialized ty

[PATCH] c++: bogus -Wparentheses warning [PR112765]

2023-11-29 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linu-xgnu, does this look OK for trunk? -- >8 -- We need to consistently look through implicit INDIRECT_REF when setting/checking for -Wparentheses warning suppression. In passing use STRIP_REFERENCE_REF consistently as well. PR c++/112765

Re: [PATCH] c++: wrong ambiguity in accessing static field [PR112744]

2023-11-29 Thread Patrick Palka
On Wed, 29 Nov 2023, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > Now that I'm posting this patch, I think you'll probably want me to use > ba_any unconditionally. That works too; g++.dg/tc1/dr52.C just needs > a trivial testsuite tweak: > 'C' is not

Re: [committed v2] libstdc++: Define std::ranges::to for C++23 (P1206R7) [PR111055]

2023-11-29 Thread Patrick Palka
On Thu, 23 Nov 2023, Jonathan Wakely wrote: > Here's the finished version of the std::ranges::to patch, which I've > pushed to trunk. > > Tested x86_64-linux. > > -- >8 -- > > This adds the std::ranges::to functions for C++23. The rest of P1206R7 > is not yet implemented, i.e. the new

[PATCH 2/2] c++: guard more against undiagnosed error_mark_node [PR112658]

2023-11-28 Thread Patrick Palka
This adds a sanity check to cp_parser_expression_statement similar to the one in finish_expr_stmt added by r6-6795-g0fd9d4921f7ba2, which effectively downgrades accepts-invalid/wrong-code bugs like this one into ice-on-invalid/ice-on-valid ones. PR c++/112658 gcc/cp/ChangeLog: *

[PATCH 1/2] c++: casting array prvalue [PR112658, PR94264]

2023-11-28 Thread Patrick Palka
Bootstrapped and regtested on x86-64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we deem the array-to-pointer conversions in both calls as invalid, but we fail to issue a diagnostic for the second call, ultimately because cp_build_c_cast doesn't replay errors from

Re: [PATCH] c++: Implement P2582R1, CTAD from inherited constructors

2023-11-27 Thread Patrick Palka
On Fri, 24 Nov 2023, Patrick Palka wrote: > On Wed, 22 Nov 2023, Patrick Palka wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk? > > > > -- >8 -- > > > > This patch implements C++23 class template argum

Re: [PATCH] c++: Implement P2582R1, CTAD from inherited constructors

2023-11-24 Thread Patrick Palka
On Wed, 22 Nov 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > trunk? > > -- >8 -- > > This patch implements C++23 class template argument deduction from > inherited constructors, which is specified in terms of C++

[PATCH] c++/modules: alias CTAD and specializations table

2023-11-24 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- A rewritten guide for alias CTAD isn't really a specialization of the original guide, so we shouldn't register it as such. This avoids an ICE in the below modules testcase which otherwise tries to inspect

Re: [PATCH] c++: Clear uninstantiated friend flag when instantiating [PR104234]

2023-11-23 Thread Patrick Palka
On Thu, 23 Nov 2023, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. > > -- >8 -- > > Otherwise attempting to get the originating module declaration ICEs > because the DECL_CHAIN of an instantiated friend template is no longer > its

[PATCH] c++: alias template of non-template class [PR112633]

2023-11-22 Thread Patrick Palka
Bootstrapped and regtested on x86-64-pc-linux-gnu, does this look OK for trunk/13? -- >8 -- The entering_scope adjustment in tsubst_aggr_type assumes if an alias is dependent, then so is the aliased type (and therefore it has template info) but that's not true for the dependent alias template

[PATCH] c++: Implement P2582R1, CTAD from inherited constructors

2023-11-22 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- This patch implements C++23 class template argument deduction from inherited constructors, which is specified in terms of C++20 alias CTAD which we already fully support. The rule for transforming the

[pushed] c++: add fixed testcases [PR98614, PR104802]

2023-11-16 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, pushed to trunk. -- >8 -- Both of these PRs are fixed by r12-1403-gc4e50e500da7692a. PR c++/98614 PR c++/104802 gcc/testsuite/ChangeLog: * g++.dg/cpp1z/nontype-auto22.C: New test. * g++.dg/cpp2a/concepts-partial-spec14.C: New

[PATCH] c++: constantness of call to function pointer [PR111703]

2023-11-15 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/13/12 (to match the PR107939 / r13-6525-ge09bc034d1b4d6 backports)? -- >8 -- potential_constant_expression for a CALL_EXPR to a non-overload tests FUNCTION_POINTER_TYPE_P on the callee rather than on the type of the

[PATCH] c++: partially inst requires-expr in noexcept-spec [PR101043]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we're ICEing from strip_typedefs for the partially instantiated requires-expression when walking its REQUIRES_EXPR_EXTRA_ARGS since it's a TREE_LIST with non-empty TREE_PURPOSE (to hold the captured

[PATCH] c++: direct enum init from type-dep elt [PR112515]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The NON_DEPENDENT_EXPR removal exposed that is_direct_enum_init may end up checking convertibility of a type-dependent argument. PR c++/112515 gcc/cp/ChangeLog: * decl.cc

[PATCH] c++: decltype of (non-captured variable) [PR83167]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- For decltype((x)) within a lambda where x is not captured, we dubiously require that the lambda has a capture default, unlike for decltype(x). This patch fixes this inconsistency; I couldn't find a

Re: [PATCH] c++: non-dependent .* folding [PR112427]

2023-11-14 Thread Patrick Palka
On Fri, 10 Nov 2023, Jason Merrill wrote: > On 11/10/23 10:28, Patrick Palka wrote: > > On Fri, 10 Nov 2023, Patrick Palka wrote: > > > > > On Thu, 9 Nov 2023, Jason Merrill wrote: > > > > > > > On 11/8/23 16:59, Patrick Palka wrote: > > >

Re: [PATCH] c++: fix tf_decltype manipulation for COMPOUND_EXPR

2023-11-10 Thread Patrick Palka
On Fri, 10 Nov 2023, Jason Merrill wrote: > On 11/10/23 12:25, Patrick Palka wrote: > > On Thu, 9 Nov 2023, Jason Merrill wrote: > > > > > On 11/7/23 10:08, Patrick Palka wrote: > > > > bootstrapped and regtested on x86_64-pc-linxu-gnu, does this look OK for &

Re: [PATCH] c++: fix tf_decltype manipulation for COMPOUND_EXPR

2023-11-10 Thread Patrick Palka
On Thu, 9 Nov 2023, Jason Merrill wrote: > On 11/7/23 10:08, Patrick Palka wrote: > > bootstrapped and regtested on x86_64-pc-linxu-gnu, does this look OK for > > trunk? > > > > -- >8 -- > > > > In the COMPOUND_EXPR case of tsubst_expr, we were redundan

Re: [PATCH] c++: non-dependent .* folding [PR112427]

2023-11-10 Thread Patrick Palka
On Fri, 10 Nov 2023, Patrick Palka wrote: > On Thu, 9 Nov 2023, Jason Merrill wrote: > > > On 11/8/23 16:59, Patrick Palka wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > > trunk? > > > > > > -- >8 -- &

Re: [PATCH] c++: non-dependent .* folding [PR112427]

2023-11-10 Thread Patrick Palka
On Thu, 9 Nov 2023, Jason Merrill wrote: > On 11/8/23 16:59, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk? > > > > -- >8 -- > > > > Here when building up the non-dependent .* expression, w

Re: [PATCH] c++: constantness of local var in constexpr fn [PR111703, PR112269]

2023-11-10 Thread Patrick Palka
On Wed, 1 Nov 2023, Patrick Palka wrote: > On Tue, 31 Oct 2023, Patrick Palka wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk? Does it look OK for release branches as well for sake of PR111703? Pin

[PATCH] libstdc++: Fix forwarding in __take/drop_of_repeat_view [PR112453]

2023-11-09 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/13? (The && overloads are also missing on earlier branches, but I don't think it makes a difference there since all uses of that operator* are on lvalues before this fix.) -- >8 -- We need to respect the value category of the

[PATCH] c++: non-dependent .* folding [PR112427]

2023-11-08 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here when building up the non-dependent .* expression, we crash from fold_convert on 'b.a' due to this (templated) COMPONENT_REF having an IDENTIFIER_NODE instead of FIELD_DECL operand that middle-end

Re: [PATCH] c++: decltype of (by-value captured reference) [PR79620]

2023-11-07 Thread Patrick Palka
On Tue, 7 Nov 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > OK for trunk? > > -- >8 -- > > The capture decltype handling in finish_decltype_type wasn't looking > through implicit INDIRECT_REF (added by convert_from_refer

[PATCH] c++: decltype of (by-value captured reference) [PR79620]

2023-11-07 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The capture decltype handling in finish_decltype_type wasn't looking through implicit INDIRECT_REF (added by convert_from_reference), which caused us to incorrectly resolve decltype((x)) to float& below. We

[PATCH] c++: decltype of capture proxy [PR79378, PR96917]

2023-11-07 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- We usually don't see capture proxies in finish_decltype_type because process_outer_var_ref is a no-op inside an unevaluated context and so a use of a capture inside decltype refers directly to the captured

[PATCH] c++: fix tf_decltype manipulation for COMPOUND_EXPR

2023-11-07 Thread Patrick Palka
bootstrapped and regtested on x86_64-pc-linxu-gnu, does this look OK for trunk? -- >8 -- In the COMPOUND_EXPR case of tsubst_expr, we were redundantly clearing the tf_decltype flag when substituting the LHS and also neglecting to propagate it when substituting the RHS. This patch corrects this

Re: Remove redundant partial specialization in _Nth_type

2023-11-03 Thread Patrick Palka
yn Sat, 28 Oct 2023, Feng Jisen wrote: > This patch remove a redundant partial specialization in class _Nth_type. > For the original metafunction _Nth_type code, >   # 0 >   template     struct _Nth_type<0, _Tp0, > _Rest...> >     { using type = _Tp0; }; >  # 1 >   template >     struct

Re: [PATCH] c++: partial spec constraint checking context [PR105220]

2023-11-03 Thread Patrick Palka
On Tue, 3 May 2022, Jason Merrill wrote: > On 5/2/22 14:50, Patrick Palka wrote: > > Currently when checking the constraints of a class template, we do so in > > the context of the template, not the specialized type. This is the best > > we can do for a primary template

Re: [PATCH] c++: constantness of local var in constexpr fn [PR111703, PR112269]

2023-11-01 Thread Patrick Palka
On Tue, 31 Oct 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > trunk? Does it look OK for release branches as well for sake of PR111703? > > -- >8 -- > > potential_constant_expression was incorrectly treating most l

[PATCH] c++: constantness of local var in constexpr fn [PR111703, PR112269]

2023-10-31 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Does it look OK for release branches as well for sake of PR111703? -- >8 -- potential_constant_expression was incorrectly treating most local variables from a constexpr function as (potentially) constant because it

Re: [PATCH v3 3/3] c++: note other candidates when diagnosing deletedness

2023-10-27 Thread Patrick Palka
On Fri, 27 Oct 2023, Patrick Palka wrote: > On Fri, 27 Oct 2023, Jason Merrill wrote: > > > On 10/27/23 15:55, Patrick Palka wrote: > > > With the previous two patches in place, we can now extend our > > > deletedness diagnostic to note the ot

Re: [PATCH v3 3/3] c++: note other candidates when diagnosing deletedness

2023-10-27 Thread Patrick Palka
On Fri, 27 Oct 2023, Jason Merrill wrote: > On 10/27/23 15:55, Patrick Palka wrote: > > With the previous two patches in place, we can now extend our > > deletedness diagnostic to note the other considered candidates, e.g.: > > > >deleted16.C: In function 'int mai

Re: [pushed] c++: fix tourney logic

2023-10-27 Thread Patrick Palka
On Fri, 27 Oct 2023, Patrick Palka wrote: > On Fri, 27 Oct 2023, Patrick Palka wrote: > > > On Fri, 20 Oct 2023, Jason Merrill wrote: > > > > > Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, sorry I didn't > > > apply > > > this sooner. &

Re: [pushed] c++: fix tourney logic

2023-10-27 Thread Patrick Palka
On Fri, 27 Oct 2023, Patrick Palka wrote: > On Fri, 20 Oct 2023, Jason Merrill wrote: > > > Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, sorry I didn't > > apply > > this sooner. > > > > -- 8< -- > > > > In r13-3766 I changed

Re: [pushed] c++: fix tourney logic

2023-10-27 Thread Patrick Palka
On Fri, 20 Oct 2023, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, sorry I didn't apply > this sooner. > > -- 8< -- > > In r13-3766 I changed the logic at the end of tourney to avoid redundant > comparisons, but the change also meant skipping any less-good

[PATCH v3 1/3] c++: sort candidates according to viability

2023-10-27 Thread Patrick Palka
New in patch 1/3: * consistently use "non-viable" instead of "unviable" throughout * make 'champ' and 'challenger' in 'tourney' be z_candidate** to simplify moving 'champ' to the front of the list. drive-by cleanups in tourney, including renaming 'champ_compared_to_predecessor'

[PATCH v3 2/3] c++: remember candidates that we ignored

2023-10-27 Thread Patrick Palka
During overload resolution, we sometimes outright ignore a function in the overload set and leave no trace of it in the candidates list, for example when we find a perfect non-template candidate we discard all function templates, or when the callee is a template-id we discard all non-template

[PATCH v3 3/3] c++: note other candidates when diagnosing deletedness

2023-10-27 Thread Patrick Palka
With the previous two patches in place, we can now extend our deletedness diagnostic to note the other considered candidates, e.g.: deleted16.C: In function 'int main()': deleted16.C:10:4: error: use of deleted function 'void f(int)' 10 | f(0); | ~^~~ deleted16.C:5:6: note:

[pushed] c++: add testcase verifying non-dep new-expr checking

2023-10-27 Thread Patrick Palka
N.B. we currently don't diagnose 'new A(1)' below ultimately because when in a template context our valid ctor call checking only happens for type_build_ctor_call types. -- >8 -- gcc/testsuite/ChangeLog: * g++.dg/template/new14.C: New test. --- gcc/testsuite/g++.dg/template/new14.C |

Re: [PATCH] c++: more ahead-of-time -Wparentheses warnings

2023-10-26 Thread Patrick Palka
On Thu, 26 Oct 2023, Patrick Palka wrote: > On Thu, 26 Oct 2023, Jason Merrill wrote: > > > On 10/25/23 14:55, Patrick Palka wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > > OK for trunk? > > > > > > -- >8 --

Re: [PATCH] c++: more ahead-of-time -Wparentheses warnings

2023-10-26 Thread Patrick Palka
On Thu, 26 Oct 2023, Jason Merrill wrote: > On 10/25/23 14:55, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > OK for trunk? > > > > -- >8 -- > > > > Now that we don't have to worry about looking thruogh NO

Re: [PATCH] c++: simplify build_new_1 when in a template context

2023-10-26 Thread Patrick Palka
On Thu, 26 Oct 2023, Jason Merrill wrote: > On 10/26/23 14:01, Patrick Palka wrote: > > Since when in a template context we end up just discarding the result > > of build_new_1, we don't have to bother with much of the code generation > > it performs. This patch makes th

[PATCH] c++: simplify build_new_1 when in a template context

2023-10-26 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Since when in a template context we end up just discarding the result of build_new_1, we don't have to bother with much of the code generation it performs. This patch makes the function exit early,

[PATCH] c++: more ahead-of-time -Wparentheses warnings

2023-10-25 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Now that we don't have to worry about looking thruogh NON_DEPENDENT_EXPR, we can easily extend the -Wparentheses warning in convert_for_assignment to consider (non-dependent) templated assignment operator

[PATCH] c++/modules: fix up recent testcases

2023-10-25 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? Declaring get() inline seems necessary to avoid link failure: /usr/bin/ld: /tmp/ccwdv6Co.o: in function `g3@pr105322.Decltype()': decltype-1_b.C:(.text._ZW8pr105322W8Decltype2g3v[_ZW8pr105322W8Decltype2g3v]+0x18): undefined

[PATCH] c++: another build_new_1 folding fix [PR111929]

2023-10-25 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- We also need to avoid folding 'outer_nelts_check' when in a template context to prevent an ICE on the below testcase. This patch achieves this by replacing the fold_build2 call with build2 (cp_fully_fold

Re: [PATCH] c++: build_new_1 and non-dep array size [PR111929]

2023-10-25 Thread Patrick Palka
On Tue, 24 Oct 2023, Jason Merrill wrote: > On 10/24/23 13:03, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > like the right approach? > > > > -- >8 -- > > > > This PR is another instance of NON_DEPEN

[pushed] c++: add fixed testcase [PR99804]

2023-10-25 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, pushed to trunk. -- >8 -- We accept the non-dependent call f(e) here ever since the NON_DEPENDENT_EXPR removal patch r14-4793-gdad311874ac3b3. I haven't looked closely into why but I suspect wrapping 'e' in a NON_DEPENDENT_EXPR was causing the argument conversion

[PATCH] c++: build_new_1 and non-dep array size [PR111929]

2023-10-24 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look like the right approach? -- >8 -- This PR is another instance of NON_DEPENDENT_EXPR having acted as an "analysis barrier" for middle-end routines, and now that it's gone we may end up passing weird templated trees (that have a

[PATCH v2 3/3] c++: note other candidates when diagnosing deletedness

2023-10-23 Thread Patrick Palka
With the previous two patches in place, we can now extend our deletedness diagnostic to note the other considered candidates, e.g.: deleted16.C: In function 'int main()': deleted16.C:10:4: error: use of deleted function 'void f(int)' 10 | f(0); | ~^~~ deleted16.C:5:6: note:

[PATCH v2 2/3] c++: remember candidates that we ignored

2023-10-23 Thread Patrick Palka
During overload resolution, we sometimes outright ignore a function from the overload set and leave no trace of it in the candidates list, for example when we find a perfect non-template candidate we discard all function templates, or when the callee is a template-id we discard all non-template

[PATCH v2 1/3] c++: sort candidates according to viability

2023-10-23 Thread Patrick Palka
The second patch in this series is new and ensures that the candidates list isn't mysteriously missing some candidates when noting other candidates due to deletedness. -- >8 -- This patch: * changes splice_viable to move the non-viable candidates to the end of the list instead of removing

[PATCH] c++: cp_stabilize_reference and non-dep exprs [PR111919]

2023-10-23 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- After the removal of NON_DEPENDENT_EXPR, cp_stabilize_reference which used to just exit early for NON_DEPENDENT_EXPR is now more prone to passing a weird templated tree to middle-end routines, which leads to

Re: [PATCH v24 33/33] libstdc++: Optimize std::is_invocable compilation performance

2023-10-23 Thread Patrick Palka
On Mon, 23 Oct 2023, Ken Matsui wrote: > On Mon, Oct 23, 2023 at 10:05 AM Patrick Palka wrote: > On Fri, Oct 20, 2023 at 12:22 PM Ken Matsui wrote: > > > > This patch optimizes the compilation performance of std::is_invocable > > by dispatching t

Re: [PATCH v24 33/33] libstdc++: Optimize std::is_invocable compilation performance

2023-10-23 Thread Patrick Palka
On Fri, Oct 20, 2023 at 12:22 PM Ken Matsui wrote: > > This patch optimizes the compilation performance of std::is_invocable > by dispatching to the new __is_invocable built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_invocable): Use __is_invocable >

Re: [PATCH v23 31/33] libstdc++: Optimize std::is_pointer compilation performance

2023-10-23 Thread Patrick Palka
On Sun, 22 Oct 2023, Ken Matsui wrote: > Hi Patrick, > > There is an issue with the code in > libstdc++-v3/include/bits/cpp_type_traits.h. Specifically, Clang 16 > does not accept the code, while Clang 17 does. Given that we aim to > support the last two versions of Clang, we need to ensure that

[pushed] objc++: type/expr tsubst conflation [PR111920]

2023-10-22 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, pushed to trunk as obvious. -- >8 -- After r14-4796-g3e3d73ed5e85e7, tsubst_copy_and_build (now named tsubst_expr) no longer dispatches to tsubst for type trees, and callers have to do it themselves if appropriate. This patch makes some

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Patrick Palka wrote: > On Fri, 20 Oct 2023, Patrick Palka wrote: > > > On Fri, 20 Oct 2023, Ken Matsui wrote: > > > > > This patch implements built-in trait for std::is_invocable. > > > > Nice! My email client unfortunately ate my

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Patrick Palka wrote: > On Fri, 20 Oct 2023, Ken Matsui wrote: > > > This patch implements built-in trait for std::is_invocable. > > Nice! My email client unfortunately ate my first review attempt, so > apologies for my brevity this time around. &g

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Ken Matsui wrote: > This patch implements built-in trait for std::is_invocable. Nice! My email client unfortunately ate my first review attempt, so apologies for my brevity this time around. > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_invocable. > *

Re: [PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-20 Thread Patrick Palka
ed simultaneously after all :) > > nathan > > On 10/18/23 12:28, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk? > > > > -- >8 -- > > > > For a local variable initialized by a lambda: > >

Re: [PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node

2023-10-20 Thread Patrick Palka
n traits. > (cp_parser_trait): Handle cp_trait instead of enum rid. > (cp_parser_simple_type_specifier): Remove all RID value cases > for built-in traits. Handle type-yielding built-in traits. > > Co-authored-by: Patrick Palka > Signed-off-by: Ken Matsu

[PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]

2023-10-20 Thread Patrick Palka
Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully). -- >8 -- This patch removes stray NON_DEPENDENT_EXPR checks following the removal of this tree code from the C++ FE. (Since this restores the build I supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in the

[PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]

2023-10-20 Thread Patrick Palka
Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully). -- >8 -- This patch removes stray NON_DEPENDENT_EXPR checks following the removal of this tree code from the C++ FE. (Since this restores the build I supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in the

Re: [PATCH] c++: print source code in print_instantiation_partial_context_line

2023-10-19 Thread Patrick Palka
On Tue, 3 Oct 2023, David Malcolm wrote: > As mentioned in my Cauldron talk, this patch adds a call to > diagnostic_show_locus to the "required from here" messages > in print_instantiation_partial_context_line, so that e.g., rather > than the rather mystifying: > > In file included from

Re: [PATCH 2/1] c++: more non-static memfn call dependence cleanup [PR106086]

2023-10-19 Thread Patrick Palka
On Thu, 19 Oct 2023, Jason Merrill wrote: > On 10/12/23 14:49, Patrick Palka wrote: > > On Tue, 26 Sep 2023, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > > > for trunk? > > > > > > -- &

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Patrick Palka
On Tue, 17 Oct 2023, Marek Polacek wrote: > On Tue, Oct 17, 2023 at 04:49:52PM -0400, Jason Merrill wrote: > > On 10/16/23 20:39, Marek Polacek wrote: > > > On Sat, Oct 14, 2023 at 01:13:22AM -0400, Jason Merrill wrote: > > > > On 10/13/23 14:53, Marek Polacek wrote: > > > > > On Thu, Oct 12,

Re: [PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-18 Thread Patrick Palka
On Wed, 18 Oct 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > trunk? Note that this doesn't fix the other testcase in the PR, which doesn't use any lambdas and which ICEs in the same way: export module pr105322;

[PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-18 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- For a local variable initialized by a lambda: auto f = []{}; The corresponding BLOCK_VARS contains the variable declaration first, followed by the closure type declaration, consistent with the

Re: [PATCH v22 02/31] c-family, c++: Look up built-in traits via identifier node

2023-10-17 Thread Patrick Palka
Handle cp_trait instead of enum rid. > (cp_parser_simple_type_specifier): Remove all RID value cases > for built-in traits. Handle type-yielding built-in traits. > > Co-authored-by: Patrick Palka > Signed-off-by: Ken Matsui > --- > gcc/c-family/c-common.cc |

Re: [PATCH v20 01/40] c++: Sort built-in traits alphabetically

2023-10-16 Thread Patrick Palka
On Mon, 16 Oct 2023, Ken Matsui wrote: > On Mon, Oct 16, 2023 at 8:17 AM Patrick Palka wrote: > > > > On Sun, 15 Oct 2023, Ken Matsui wrote: > > > > > This patch sorts built-in traits alphabetically for better code > > > readability. > > > >

Re: [PATCH v20 02/40] c-family, c++: Look up built-in traits via identifier node

2023-10-16 Thread Patrick Palka
On Mon, 16 Oct 2023, Ken Matsui wrote: > On Mon, Oct 16, 2023 at 7:55 AM Patrick Palka wrote: > > > > On Sun, 15 Oct 2023, Ken Matsui wrote: > > > > > Since RID_MAX soon reaches 255 and all built-in traits are used > > > approximately > > > once i

Re: [PATCH v20 26/40] libstdc++: Optimize is_object trait performance

2023-10-16 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > This patch optimizes the performance of the is_object trait by dispatching to > the new __is_function and __is_reference built-in traits. > > libstdc++-v3/ChangeLog: > * include/std/type_traits (is_object): Use __is_function and >

Re: [PATCH v20 31/40] c++: Implement __is_arithmetic built-in trait

2023-10-16 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > This patch implements built-in trait for std::is_arithmetic. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_arithmetic. > * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. > * semantics.cc (trait_expr_value):

Re: [PATCH v20 30/40] libstdc++: Optimize is_pointer trait performance

2023-10-16 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > This patch optimizes the performance of the is_pointer trait by dispatching to > the new __is_pointer built-in trait. > > libstdc++-v3/ChangeLog: > > * include/bits/cpp_type_traits.h (__is_pointer): Use __is_pointer > built-in trait. >

Re: [PATCH v20 01/40] c++: Sort built-in traits alphabetically

2023-10-16 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > This patch sorts built-in traits alphabetically for better code > readability. Hmm, I'm not sure if we still want/need this change with this current approach. IIUC gperf would sort the trait names when generating the hash table code, and so we wanted a

Re: [PATCH v20 03/40] c++: Accept the use of built-in trait identifiers

2023-10-16 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > This patch accepts the use of built-in trait identifiers when they are > actually not used as traits. Specifically, we check if the subsequent token > is '(' for ordinary built-in traits or is '<' only for the special > __type_pack_element built-in trait.

Re: [PATCH v20 02/40] c-family, c++: Look up built-in traits via identifier node

2023-10-16 Thread Patrick Palka
arser_simple_type_specifier): Remove all RID value cases > for built-in traits. Handle type-yielding built-in traits. > > Co-authored-by: Patrick Palka > Signed-off-by: Ken Matsui > --- > gcc/c-family/c-common.cc | 7 -- > gcc/c-family/c-common.h | 5 -

Re: [PATCH v19 02/40] c-family, c++: Look up built-in traits through gperf

2023-10-15 Thread Patrick Palka
On Sun, 15 Oct 2023, Ken Matsui wrote: > On Sun, Oct 15, 2023 at 1:43 PM Patrick Palka wrote: > > > > On Fri, 13 Oct 2023, Ken Matsui wrote: > > > > > Since RID_MAX soon reaches 255 and all built-in traits are used > > > approximately > > > once i

Re: [PATCH v19 02/40] c-family, c++: Look up built-in traits through gperf

2023-10-15 Thread Patrick Palka
built-in traits. Handle expression-yielding built-in traits. > (cp_parser_trait): Handle cp_trait instead of enum rid. > (cp_parser_simple_type_specifier): Remove all RID value cases > for built-in traits. Handle type-yielding built-in traits. > * cp-trait-head.

Re: [PATCH 2/1] c++: more non-static memfn call dependence cleanup [PR106086]

2023-10-12 Thread Patrick Palka
On Tue, 26 Sep 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > for trunk? > > -- >8 -- > > This follow-up patch removes some more repetition of the type-dependent On second thought there's no good reason to split these pa

Re: [PATCH v17 02/39] c-family, c++: Look up built-in traits through gperf

2023-10-12 Thread Patrick Palka
On Wed, 11 Oct 2023, Ken Matsui wrote: > Since RID_MAX soon reaches 255 and all traits are used approximately once in > a C++ translation unit, this patch instead uses only RID_TRAIT_EXPR and > RID_TRAIT_TYPE for all traits and uses gperf to look up the specific trait. > >

Re: [PATCH v16 02/39] c-family, c++: Look up built-in traits through gperf

2023-10-11 Thread Patrick Palka
On Tue, 10 Oct 2023, Ken Matsui wrote: > Since RID_MAX soon reaches 255 and all traits are used approximately once in > a C++ translation unit, this patch instead uses only RID_TRAIT_EXPR and > RID_TRAIT_TYPE for all traits and uses gperf to look up the specific trait. Nice! This looks good to

[PATCH 2/2] c++: note other candidates when diagnosing deletedness

2023-10-09 Thread Patrick Palka
With the previous improvements in place, we can easily extend our deletedness diagnostic to note the other candidates: deleted16.C: In function ‘int main()’: deleted16.C:10:4: error: use of deleted function ‘void f(int)’ 10 | f(0); | ~^~~ deleted16.C:5:6: note: declared

[PATCH 1/2] c++: sort candidates according to viability

2023-10-09 Thread Patrick Palka
This patch: * changes splice_viable to move the non-viable candidates to the end of the list instead of removing them outright * makes tourney move the best candidate to the front of the candidate list * adjusts print_z_candidates to preserve our behavior of printing only viable

[PATCH 2/1] c++: rename tsubst_copy_and_build and tsubst_expr

2023-10-04 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- After the previous patch, we currently have two tsubst entry points for expression trees: tsubst_copy_and_build and tsubst_expr. But the latter is just a superset of the former that also handles statement

Re: [PATCH] c++: merge tsubst_copy into tsubst_copy_and_build

2023-10-04 Thread Patrick Palka
On Tue, 3 Oct 2023, Jason Merrill wrote: > On 10/3/23 08:41, Patrick Palka wrote: > > On Mon, 2 Oct 2023, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > > OK for trunk? > > > > >

Re: [PATCH] c++: merge tsubst_copy into tsubst_copy_and_build

2023-10-03 Thread Patrick Palka
On Mon, 2 Oct 2023, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > OK for trunk? > > -- >8 -- > > The relationship between tsubst_copy_and_build and tsubst_copy (two of > the main template argument substitution routi

[PATCH] c++: merge tsubst_copy into tsubst_copy_and_build

2023-10-02 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The relationship between tsubst_copy_and_build and tsubst_copy (two of the main template argument substitution routines for expression trees) is rather hazy. The former is mostly a superset of the latter,

Re: [PATCH 1/2] c++: remove NON_DEPENDENT_EXPR, part 1

2023-09-27 Thread Patrick Palka
On Tue, 26 Sep 2023, Jason Merrill wrote: > On 9/25/23 16:43, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > > for trunk? > > > > -- >8 -- > > > > This tree code dates all the way back to r69130[1] whi

[PATCH 2/1] c++: more non-static memfn call dependence cleanup [PR106086]

2023-09-26 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- This follow-up patch removes some more repetition of the type-dependent case of finish_call_expr, this time in of tsubst_copy_and_build. This allows us to easily fix PR106086 -- which is about us failing to

[PATCH] c++: non-static memfn call dependence cleanup

2023-09-26 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- In cp_parser_postfix_expression, we essentially repeat the type-dependent and COMPONENT_REF callee cases of finish_call_expr. This patch deduplicates this logic. gcc/cp/ChangeLog: * parser.cc

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