[PATCH] D41992: [libcxx] Avoid spurious construction of valarray elements

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 10:07:20 PST 2018


mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.

This LGTM.



================
Comment at: include/valarray:3728
+{
+    __clear();
     if (__n)
----------------
I thought that you had lost an exception guarantee here, but it turns out that there wasn't one before.  If the allocation fails, you are left with an empty array instead of the old contents.




https://reviews.llvm.org/D41992





More information about the cfe-commits mailing list