[libcxx-commits] [libcxx] [libc++][test] Merge test files for `mdspan::at` (PR #199330)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 23 01:42:28 PDT 2026


================
@@ -312,6 +313,77 @@ static void test_throws() {
 
   [[maybe_unused]] std::array bad_col{0, 10};
   TEST_THROWS_TYPE(std::out_of_range, m.at(std::span{bad_col}));
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+  auto verify_exception_message = [](auto&& f) {
+    try {
+      f();
+      assert(false && "Unexpected");
+    } catch (const std::out_of_range& e [[maybe_unused]]) {
+      LIBCPP_ASSERT(std::string_view(e.what()) == "mdspan");
----------------
eiytoq wrote:

Since exception messages are implementation-defined, should we test them in `std/`?

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


More information about the libcxx-commits mailing list