On Wed, 1 May 2024, Jason Merrill wrote: > On 5/1/24 12:41, Patrick Palka wrote: > > On Fri, 2 Feb 2024, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux, does this look like > > > an improvement? This is not a bugfix and barely related to the previous > > > patch, but the previous patch's new use of entering_scope=true motivated > > > me to submit this patch since it seems like a nice simplification. > > > > Ping, now that stage 1 is open. > > Thanks for the ping. The earlier message isn't showing up in Thunderbird for > some reason, though I see it in the gmail web interface...
Ah, weird. No worries, this patch was very much stage 1 material anyway. > > > > @@ -16771,9 +16722,10 @@ tsubst (tree t, tree args, tsubst_flags_t > > > complain, tree in_decl) > > > ctx = TREE_VEC_ELT (ctx, 0); > > > } > > > else > > > - ctx = tsubst_aggr_type (ctx, args, > > > - complain | tf_qualifying_scope, > > > - in_decl, /*entering_scope=*/1); > > > + { > > > + ctx = tsubst_scope (ctx, args, complain, in_decl); > > Why is this one tsubst_scope while the others are all plain tsubst? Ah, just because the call to tsubst_aggr_type being replace passes tf_qualifying_scope already, so we might as well use tsubst_scope as shorthand. > > Do we want a tsubst_entering_scope function? Which is just shorthand for tsubst + adjust_type_for_entering_scope? Sure, though I was wondering if we eventually might want to get rid of the distinction between the primary template type A<T> and the generic instantiation A<T>, and we could treat this as an incremental step towards that (then we'd just eventually remove the adjust_type_for_entering_scope calls and keep the tsubst calls). > > > > + ctx = adjust_type_for_entering_scope (ctx); > >