On 10/25/23 12:03, Patrick Palka wrote:
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look
OK for trunk?

-- >8 --

We also need to avoid folding 'outer_nelts_check' when in a template
context to prevent an ICE on the below testcase.  This patch achieves
this by replacing the fold_build2 call with build2 (cp_fully_fold will
later fold the overall expression if appropriate).

In passing, this patch removes an unnecessary call to convert on 'nelts'
since it should always already be a size_t (and 'convert' isn't the best
conversion entry point to use anyway since it doesn't take a complain
parameter.)

        PR c++/111929

gcc/cp/ChangeLog:

        * init.cc (build_new_1): Remove unnecessary call to convert
        on 'nelts'.

OK.

 Use build2 instead of fold_build2 for 'outer_nelts_checks'.

Also OK, but can we skip that whole block when processing_template_decl? Seems no point to build runtime checks.

Jason

Reply via email to