[libcxx-commits] [libcxx] [libcxx] Use alias for detecting overriden function (PR #114961)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 5 12:34:13 PST 2024


================
@@ -54,7 +54,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
 #  ifdef _LIBCPP_HAS_NO_EXCEPTIONS
 #    if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
   _LIBCPP_ASSERT_SHIM(
-      !std::__is_function_overridden(static_cast<void* (*)(std::size_t)>(&operator new)),
+      !std::__is_function_overridden<std::__overload_of<void* (std::size_t)>(&operator new)>(),
----------------
ldionne wrote:

What's the benefit of using `__overload_of` here instead of just `static_cast`?

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


More information about the libcxx-commits mailing list