[PATCH] D35470: [libcxx] Implement std::to_address for C++20

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 19 17:59:47 PST 2017


EricWF added a comment.

Initially this LGTM. I'll take another pass in the morning.



================
Comment at: include/memory:1096
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
 _Tp*
----------------
Just make this unconditionally constexpr. 


================
Comment at: test/std/utilities/memory/pointer.conversion/to_address.pass.cpp:100
+{
+    int i = 0;
+    int* p = &i;
----------------
Could you add some tests that run at compile time using `static_assert`.

Also, could you verify the functions are correctly marked `noexcept` using `ASSERT_NOEXCEPT` from `test_macros.h`?


https://reviews.llvm.org/D35470





More information about the cfe-commits mailing list