aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/paste12-2.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-03-28 15:41:41 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2025-03-31 22:54:08 +0100
commit1f6c19f307c8de9830130a0ba071c24e3835beb3 (patch)
tree233dcc42a959fc29954869c8dacd83f316750ddc /gcc/testsuite/gcc.dg/cpp/paste12-2.c
parent97cbe3cd5f36470884e940bda4469dc9b5b93cfd (diff)
downloadgcc-1f6c19f307c8de9830130a0ba071c24e3835beb3.zip
gcc-1f6c19f307c8de9830130a0ba071c24e3835beb3.tar.gz
gcc-1f6c19f307c8de9830130a0ba071c24e3835beb3.tar.bz2
libstdc++: Fix -Wstringop-overread warning in std::vector<bool> [PR114758]
As in r13-4393-gcca06f0d6d76b0 and a few other commits, we can avoid bogus warnings in std::vector<bool> by hoisting some loads to before the allocation that calls operator new. This means that the compiler has enough info to remove the dead branches that trigger bogus warnings. On trunk this is only needed with -fno-assume-sane-operators-new-delete but it will help on the branches where that option doesn't exist. libstdc++-v3/ChangeLog: PR libstdc++/114758 * include/bits/vector.tcc (vector<bool, A>::_M_fill_insert): Hoist loads of begin() and end() before allocation. * testsuite/23_containers/vector/bool/capacity/114758.cc: New test. Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/paste12-2.c')
0 files changed, 0 insertions, 0 deletions