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 the function exit early, returning a dummy > > non-erroneous result, once we've done pretty much all ahead of time checks > > that we could have. In passing avoid building up 'outer_nelts_check' in > > a template context too. > > It seems like this stops checking the calls to the constructor and operator > delete?
Oops, indeed... I missed that the removed processing_template_decl hunk still checks the constructor via build_special_member_call. Never mind then, I guess the function doesn't admit any easy simplification after all :( I'll add a testcase verifying such ahead of time checking of new-exprs. > > Jason > >