diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-05-21 15:29:02 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-05-27 12:15:41 +0100 |
commit | ae1c59c8de43a2cae494ce2212f44be08a629216 (patch) | |
tree | 2c120f1a5492868698aa7b2d6bd15c4909e8cdec /gcc | |
parent | a0e365b7361f685655cd45edd424804423bb6931 (diff) | |
download | gcc-ae1c59c8de43a2cae494ce2212f44be08a629216.zip gcc-ae1c59c8de43a2cae494ce2212f44be08a629216.tar.gz gcc-ae1c59c8de43a2cae494ce2212f44be08a629216.tar.bz2 |
libstdc++: Fix vector(from_range_t, R&&) for exceptions [PR120367]
Because this constructor delegates to vector(a) the object has been
fully constructed and the destructor will run if an exception happens.
That means we need to set _M_finish == _M_start so that the destructor
doesn't try to destroy any elements.
libstdc++-v3/ChangeLog:
PR libstdc++/120367
* include/bits/stl_vector.h (_M_range_initialize): Initialize
_M_impl._M_finish.
* testsuite/23_containers/vector/cons/from_range.cc: Check with
a type that throws on construction.
exceptions during construction.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
(cherry picked from commit 04f2be72b1deecd6c6d454e000cfc0cb16db957c)
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions