Index: libcxx/include/memory =================================================================== --- libcxx/include/memory +++ libcxx/include/memory @@ -43,7 +43,7 @@ template using rebind = U*; - static pointer pointer_to(
) noexcept; + static constexpr pointer pointer_to(
) noexcept; }; template constexpr T* to_address(T* p) noexcept; // C++20 @@ -984,7 +984,7 @@ private: struct __nat {}; public: - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 static pointer pointer_to(typename conditional::value, __nat, element_type>::type& __r) _NOEXCEPT {return _VSTD::addressof(__r);} Index: libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp =================================================================== --- libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp +++ libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp @@ -12,15 +12,18 @@ // template // struct pointer_traits // { -// static pointer pointer_to(
); +// constexpr static pointer pointer_to(
); // ... // }; #include #include +#include "test_macros.h" -int main() -{ +#if TEST_STD_VER >= 20 +constexpr +#endif +bool check() { { int i = 0; static_assert((std::is_same::pointer_to(i))>::value), ""); @@ -30,4 +33,12 @@ { (std::pointer_traits::element_type)0; } + return true; +} + +int main() { + check(); +#if TEST_STD_VER >= 20 + static_assert(check(), ""); +#endif } Index: libcxx/www/upcoming_meeting.html =================================================================== --- libcxx/www/upcoming_meeting.html +++ libcxx/www/upcoming_meeting.html @@ -54,7 +54,7 @@ P0655R0LWGvisit<R>: Explicit Return Type for visitSan Diego P0972R0LWG<chrono> zero(), min(), and max() should be noexceptSan DiegoSee D53828 P1004R0LWGMaking std::vector constexprSan Diego - P1006R0LWGConstexpr in std::pointer_traitsSan Diego + P1006R0LWGConstexpr in std::pointer_traitsSan DiegoSee D53867 P1032R0LWGMisc constexpr bitsSan Diego D1148LWGCleaning up Clause 20San Diego D1163LWGExplicitly Implicifying explicit ConstructorsSan Diego