diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-10-27 11:31:02 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-10-27 11:31:02 -0400 |
commit | 6ff8b93c7b0bf3913fb7754f9985e7e31c46d89c (patch) | |
tree | 488c41a8ba24ac5fde8d26b7649a8f58e369eba2 /gcc/expr.cc | |
parent | 68e97c5442ebb1c47bde77e82ac8a0e823347eb1 (diff) | |
download | gcc-6ff8b93c7b0bf3913fb7754f9985e7e31c46d89c.zip gcc-6ff8b93c7b0bf3913fb7754f9985e7e31c46d89c.tar.gz gcc-6ff8b93c7b0bf3913fb7754f9985e7e31c46d89c.tar.bz2 |
c++: another build_new_1 folding fix [PR111929]
In build_new_1, we also need to avoid folding 'outer_nelts_check' when
in a template context to prevent an ICE on the below testcase. This
patch replaces the problematic fold_build2 call with build2 (we'll later
fold it if appropriate during cp_fully_fold).
In passing, this patch removes an unnecessary conversion of 'nelts'
since it should always already be a size_t (and 'convert' isn't the best
conversion entry point to use anyway since it lacks a complain parameter).
PR c++/111929
gcc/cp/ChangeLog:
* init.cc (build_new_1): Remove unnecessary call to convert
on 'nelts'. Use build2 instead of fold_build2 for
'outer_nelts_checks'.
gcc/testsuite/ChangeLog:
* g++.dg/template/non-dependent28a.C: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions