Skip to content

Commit 7f5eea4

Browse files
authored
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.
1 parent 49d19fe commit 7f5eea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/detail/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ template <typename T>
697697
using remove_reference_t = typename std::remove_reference<T>::type;
698698
#endif
699699

700-
#if defined(PYBIND11_CPP20)
700+
#if defined(PYBIND11_CPP20) && defined(__cpp_lib_remove_cvref)
701701
using std::remove_cvref;
702702
using std::remove_cvref_t;
703703
#else

0 commit comments

Comments
 (0)