[libcxx-commits] [libcxx] Add exception guard for constructor vector(n, x, a) (PR #113086)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 23 21:05:34 PDT 2024


winner245 wrote:

Hi team,

Following @frederick-vs-ja's suggestion and reviewing the prior work by @philnik777, I have included an additional exception test in the existing file libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp. This new test checks for memory leaks in scenarios where vector(size_type, value_type, const allocator_type&) might throw, ensuring no memory is leaked in such cases. I have compiled the entire project and run the new test to confirm that this change does not introduce new problems. 

Thank you, @frederick-vs-ja, for your valuable suggestion!

https://github.com/llvm/llvm-project/pull/113086


More information about the libcxx-commits mailing list