From d8fb8584b6b4914adafc358aa13156a9a86a962e Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Mon, 21 Jul 2025 11:00:03 -0500 Subject: [PATCH] Check for __cpp_lib_remove_cvref as well C++20 can be enabled while the C++ runtime is still much older so use the feature macro to check for it. For example, we are using the latest clang with c++23 on SLES, while the gcc version is 7. --- include/pybind11/detail/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 33f7888f7e..4ec00e45bd 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -697,7 +697,7 @@ template using remove_reference_t = typename std::remove_reference::type; #endif -#if defined(PYBIND11_CPP20) +#if defined(PYBIND11_CPP20) && defined(__cpp_lib_remove_cvref) using std::remove_cvref; using std::remove_cvref_t; #else