[libcxx-commits] [PATCH] D111925: [libc++][NFC] Mark LWG3573 as complete

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 16 07:13:18 PDT 2021


Mordante requested changes to this revision.
Mordante added a comment.
This revision now requires changes to proceed.

Thanks for addressing these LWG-issues.



================
Comment at: libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp:54
+constexpr std::iter_difference_t<I> operator-(throwing_sized_sentinel<I>, std::input_or_output_iterator auto) {
+  throw std::runtime_error("LWG 3573");
+  return {};
----------------
It's possible to use Clang in a way it won't throw exceptions. This test fails in that context. Please guard all code you added with `#ifndef TEST_HAS_NO_EXCEPTIONS`. 


================
Comment at: libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp:55
+  throw std::runtime_error("LWG 3573");
+  return {};
+}
----------------
Is there a reason for this return?


================
Comment at: libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp:59
+template <class CharT, class Sentinel>
+constexpr bool test_noexcept() {
+  auto val = MAKE_STRING_VIEW(CharT, "test");
----------------
I'm not fond of `constexpr` since throwing isn't allowed in a `constexpr` function.


================
Comment at: libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp:64
+  } catch (const std::runtime_error&) {
+    return true;
+  }
----------------
Please test the result of comparing the exception's `what()` against `"LWG 3573"`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111925



More information about the libcxx-commits mailing list