[libcxx-commits] [libcxx] [libc++][atomics] P3936R1: Safer ``atomic_ref::address`` (PR #189761)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 1 01:02:24 PDT 2026


================
@@ -224,7 +228,7 @@ struct __atomic_ref_base {
   _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }
   _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }
 #  if _LIBCPP_STD_VER >= 26
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* address() const noexcept { return __ptr_; }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __address_return_t address() const noexcept { return __ptr_; }
----------------
H-G-Hristov wrote:

I was keen on keeping because of the nice name it but then it is an exposition only type and a few lines less, so I guess less is more. Thanks for the suggestion.

https://github.com/llvm/llvm-project/pull/189761


More information about the libcxx-commits mailing list