[libcxx-commits] [libcxx] [libc++] LWG3870: Remove voidify (PR #107683)

Danil Sidoruk via libcxx-commits libcxx-commits at lists.llvm.org
Sat Sep 7 03:27:59 PDT 2024


https://github.com/eoan-ermine created https://github.com/llvm/llvm-project/pull/107683

Closes #105119 

>From 83b90e37c70252efb3b007fe8f7e62020431d019 Mon Sep 17 00:00:00 2001
From: Danil Sidoruk <danilsidoruknv at yandex.ru>
Date: Sat, 7 Sep 2024 13:24:52 +0300
Subject: [PATCH] [libc++] LWG3870: Remove voidify

---
 libcxx/include/__memory/voidify.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libcxx/include/__memory/voidify.h b/libcxx/include/__memory/voidify.h
index dbd083bd8c1e9a..a34c10aa5315ca 100644
--- a/libcxx/include/__memory/voidify.h
+++ b/libcxx/include/__memory/voidify.h
@@ -21,8 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <typename _Tp>
 _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void* __voidify(_Tp& __from) {
-  // Cast away cv-qualifiers to allow modifying elements of a range through const iterators.
-  return const_cast<void*>(static_cast<const volatile void*>(std::addressof(__from)));
+  return std::addressof(__from);
 }
 
 _LIBCPP_END_NAMESPACE_STD



More information about the libcxx-commits mailing list