[libcxx-commits] [PATCH] D105296: [libcxx] Update optional star operator to be noexcept.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 1 10:50:05 PDT 2021


zoecarver added inline comments.


================
Comment at: libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp:40
         ASSERT_SAME_TYPE(decltype(*opt), X const&);
+        LIBCPP_STATIC_ASSERT(noexcept(*opt));
         // ASSERT_NOT_NOEXCEPT(*opt);
----------------
Quuxplusone wrote:
> Should use `ASSERT_NOEXCEPT(*opt);`
> However, is this guaranteed by the Standard? or should this actually be a new test file in libcxx/test/libcxx/ because it's a conforming extension we're doing?
> If new file, then I think one file (not four) would suffice: `dereference_noexcept.compile.pass.cpp` or something like that.
`LIBCPP_STATIC_ASSERT` means it will only be checked for libc++. I think this is fine. I'd rather not add another file (putting it here also makes it far easier to find). 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105296



More information about the libcxx-commits mailing list