On Mon, 27 Jan 2025, Jason Merrill wrote: > On 1/27/25 4:17 PM, Patrick Palka wrote: > > On Mon, 27 Jan 2025, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > > OK for trunk/14? > > OK.
Thanks, pushed. > > > > + && (cxx_dialect < cxx23 || !deduction_guide_p (NODE))) \ > > > > N.B. I decided to check cxx_dialect here since deduction_guide_p seems > > relatively expensive to call? In another version of this patch I made > > us track dguide-ness via a dedicated bit flag instead of the DECL_NAME > > comparison to make the predicate essentially free (and potentially also > > more robust) but I eventually shelved that as more stage 1 material. > > deduction_guide_p doesn't look like a significant expense to me; I wouldn't > bother trying to optimize it without profile data as evidence. Yep, can confirm that it's insignificant. And DECL_FRIEND_CONTEXT isn't used in any particularly hot code so the implied memory barrier of the deduction_guide_p call doesn't matter either (though I guess it'd be good to mark it and other such predicates 'pure' anyway). > > Jason > >