[libcxx-commits] [libcxx] [libcxx] address of all the things. (PR #102832)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Aug 11 16:41:24 PDT 2024


================
@@ -1630,11 +1630,11 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* c_str() const _NOEXCEPT { return data(); }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* data() const _NOEXCEPT {
-    return std::__to_address(__get_pointer());
+    return std::addressof(__get_pointer());
----------------
frederick-vs-ja wrote:

The current change doesn't seem right. `__get_pointer` already returns a pointer prvalue, and thus we should use it directly and cannot use `addreessof` on it.

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


More information about the libcxx-commits mailing list