[libcxx-commits] [PATCH] D128214: [libc++] Makes `unique_ptr operator*() noexcept.
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Sep 12 10:26:19 PDT 2023
ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
================
Comment at: libcxx/include/__memory/unique_ptr.h:272
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const
+#if _LIBCPP_STD_VER >= 20
----------------
`_LIBCPP_HIDE_FROM_ABI` while we're at it.
================
Comment at: libcxx/include/__memory/unique_ptr.h:284
+#else // _LIBCPP_STD_VER >= 20
+ _NOEXCEPT_(noexcept(*std::declval<pointer>()))
+#endif // _LIBCPP_STD_VER >= 20
----------------
I don't understand. Why is the `void*` case not important pre-C++20?
================
Comment at: libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp:27
+struct Deleter {
+ using pointer = ThrowDereference;
+ TEST_CONSTEXPR_CXX23 void operator()(ThrowDereference&) const {}
----------------
I don't think this typedef is needed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128214/new/
https://reviews.llvm.org/D128214
More information about the libcxx-commits
mailing list