[libcxx-commits] [libcxx] [libc++] Prevent ADL on _Block_copy/_Block_release (PR #179614)

Fady Farag via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 5 03:20:47 PST 2026


https://github.com/iidmsa updated https://github.com/llvm/llvm-project/pull/179614

>From d1a4d0c83ef3f5d2cb6880e2a60dc04db6abb33a Mon Sep 17 00:00:00 2001
From: Fady Farag <com.webkit.iidmsa at gmail.com>
Date: Wed, 4 Feb 2026 00:01:04 -0600
Subject: [PATCH] [libc++] Prevent ADL on _Block_copy/_Block_release

Suppress ADL on Blocks runtime calls in std::function.
---
 libcxx/include/__functional/function.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index 121417f90ff01..c1675879ec19f 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -540,7 +540,7 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Rp(_ArgTypes...)> : public __base<_Rp(_Ar
 #    if __has_feature(objc_arc)
       : __f_(__f)
 #    else
-      : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
+      : __f_(reinterpret_cast<__block_type>(__f ? __function::_Block_copy(__f) : nullptr))
 #    endif
   {
   }
@@ -563,7 +563,7 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Rp(_ArgTypes...)> : public __base<_Rp(_Ar
   _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT {
 #    if !__has_feature(objc_arc)
     if (__f_)
-      _Block_release(__f_);
+      __function::_Block_release(__f_);
 #    endif
     __f_ = 0;
   }



More information about the libcxx-commits mailing list