[libcxx-commits] [PATCH] D112068: [libcxx] Throw correct exception from std::vector::reserve

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 19 11:12:22 PDT 2021


ldionne added inline comments.


================
Comment at: libcxx/include/vector:1592
     if (__n > capacity())
     {
+        if (__n > max_size())
----------------
Do we need to fix this in `vector<bool>` too?


================
Comment at: libcxx/test/libcxx/containers/sequences/vector.bool/reserve.pass.cpp:1
+//===----------------------------------------------------------------------===//
+//
----------------
I assume you thought about it and there's no way to test this without relying on libc++ internal details? It would be great if there was a way to avoid that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112068/new/

https://reviews.llvm.org/D112068



More information about the libcxx-commits mailing list