-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++] strong exception safety not guaranteed by std::vector<T,Allocator>::insert #112362
Comments
Why do you think there is a strong exception guarantee for |
It is not the copy/move construction/assignment that throws, we are copying ints. The allocator throws. |
Sure, but IMO this is a distinction without a difference here. Copy constructing an object means calling |
Also note that that interpretation would make it impossible to fulfill the strong exception guarantee in the |
#80558 seemed to cause this issue. In LLVM 18 the program worked as expected.
It seems that the standard wording is very defective here. There're already LWG2158 and LWG4123. Moreover, copy/move constructors are mentioned, but |
The following code
fails with
Tested on x86_64 latest: https://godbolt.org/z/7Gjsh9e6f
The text was updated successfully, but these errors were encountered: