[PATCH] D15862: A possible direction for fixing https://llvm.org/bugs/show_bug.cgi?id=25973.

Tim Song via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 7 09:17:21 PST 2016


tcanens added inline comments.

================
Comment at: include/string:2677-2678
@@ +2676,4 @@
+#endif
+        for (; __first != __last; ++__first)
+            push_back(*__first);
+
----------------
If an exception is thrown after a `push_back()` causes reallocation, existing iterators/pointers/references would have been invalidated, and the `catch` block can't do anything about it.

It looks like a temporary string is also needed here.


http://reviews.llvm.org/D15862





More information about the cfe-commits mailing list