Check for __cpp_lib_remove_cvref as well (#5761)

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.
This commit is contained in:
Paul Fultz II
2025-07-24 12:01:18 -05:00
committed by GitHub
parent 49d19fef68
commit 7f5eea432e

View File

@@ -697,7 +697,7 @@ template <typename T>
using remove_reference_t = typename std::remove_reference<T>::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