Re: [PATCH] c++: constrained auto in lambda using outer tparms [PR103706]

2022-02-03 Thread Patrick Palka via Gcc-patches
, > > > tree *); > > > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > > > index 6e129da1d05..c919d2de68f 100644 > > > --- a/gcc/cp/pt.cc > > > +++ b/gcc/cp/pt.cc > > > @@ -573,6 +573,9 @@ add_to_template_args (tree args, tree extra_args) > > >

Re: [PATCH] c++: constrained auto in lambda using outer tparms [PR103706]

2022-02-02 Thread Jason Merrill via Gcc-patches
epth 1 targ vector (whereas for the calls in satisfy_declaration_constraints and do_auto_deduction we want NULL_TREE extra_args to be treated as a depth 0 targ vector). Please consider the below patch instead, which doesn't attempt to change the behavior of add_to_template_args: -- >8 --

Re: [PATCH] c++: constrained auto in lambda using outer tparms [PR103706]

2022-02-02 Thread Patrick Palka via Gcc-patches
template_args treating NULL_TREE extra_args as a depth 1 targ vector (whereas for the calls in satisfy_declaration_constraints and do_auto_deduction we want NULL_TREE extra_args to be treated as a depth 0 targ vector). Please consider the below patch instead, which doesn't attempt to change the beha

[PATCH] c++: constrained auto in lambda using outer tparms [PR103706]

2022-02-02 Thread Patrick Palka via Gcc-patches
Here we're crashing during satisfaction of the lambda's placeholder type constraints because the constraints depend on the template arguments from the enclosing scope, which aren't a part of the lambda's DECL_TI_ARGS. So when inside a lambda, do_auto_deduction needs to add the "regenerating" templ