This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/86295] Missing exception safety when inserting range into vector


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86295

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Kristian Spangsege from comment #0)
> The problem occurs when either `std::__uninitialized_copy_a()` or
> `std::__uninitialized_move_a()` throws due to throwing from the copy or move
> constructor of the value type. In this case, the logical size of the vector
> remains at its prior value, which means that if any objects were created,
> they will be forgotten about (leaked).

Do you have a testcase?

If an exception occurs in __uninitialized_copy_a and __uninitialized_move_a
they will destroy any objects they created, so I don't see how they can leak.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]