diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2024-05-16 06:59:50 +0200 |
---|---|---|
committer | François Dumont <frs.dumont@gmail.com> | 2024-05-29 16:42:50 +0200 |
commit | d22eaeca7634b57e80ea61cadd82902fdc7e57ea (patch) | |
tree | 475fca6bc118712c0c78ddd0d26ef1c4b728d821 /libcpp | |
parent | b24b081113c696f4e523c8ae53fc3ab89c3b4e4d (diff) | |
download | gcc-d22eaeca7634b57e80ea61cadd82902fdc7e57ea.zip gcc-d22eaeca7634b57e80ea61cadd82902fdc7e57ea.tar.gz gcc-d22eaeca7634b57e80ea61cadd82902fdc7e57ea.tar.bz2 |
libstdc++: Use RAII to replace try/catch blocks
Move _Guard into std::vector declaration and use it to guard all calls to
vector _M_allocate.
Doing so the compiler has more visibility on what is done with the pointers
and do not raise anymore the -Wfree-nonheap-object warning.
libstdc++-v3/ChangeLog:
* include/bits/vector.tcc (_Guard): Move all the nested duplicated class...
* include/bits/stl_vector.h (_Guard_alloc): ...here and rename.
(_M_allocate_and_copy): Use latter.
(_M_initialize_dispatch): Small code simplification.
(_M_range_initialize): Likewise and set _M_finish first from the result
of __uninitialize_fill_n_a that can throw.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions