On Fri, 2 Feb 2024, Jason Merrill wrote: > On 2/2/24 14:41, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this > > look OK for trunk? > > > > -- >8 -- > > > > In r11-3261-gb28b621ac67bee we made tsubst_requires_expr never partially > > substitute into a requires-expression so as to avoid checking its > > requirements out of order during e.g. generic lambda regeneration. > > > > Unfortunately we still do need to partially substitute into a > > requires-expression in rare cases, in particular when it's used in > > associated constraints that we are directly substituting for sake of > > declaration matching or dguide constraint rewriting. We can identify > > this situation by checking processing_constraint_expression_p, so this > > patch uses this predicate to control whether we defer substitution or > > partially substitute. The entering_scope=true change in tsubst_baselink > > is needed to avoid ICEing from tsubst_baselink during name lookup when > > rewriting std::ranges::ref_view's dguide constraints. > > Actually, I don't think we want to enter the scope when rewriting constraints. > Would tsubst_scope work instead?
Oops yes, because of the maybe_dependent_member_ref stuff, the handling for which doesn't trigger here for some reason. Ah, I think it's because the tf_dguide flag gets dropped during tsubst_requires_expr since it uses tf_none rather than complain & ~tf_warning_or_error which would preserve special tsubst flags such as tf_dguide. I'll fix... > > Jason > >