From f10c40fca965d04034a8f85d8fbb26818af49ca0 Mon Sep 17 00:00:00 2001 From: ObeliskGate Date: Fri, 16 Aug 2024 15:46:07 +0800 Subject: [PATCH] fix: disable `ranges` in clang < 16 --- include/pybind11/detail/common.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 082e78ef53..aa6c4c0544 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -273,7 +273,13 @@ PYBIND11_WARNING_DISABLE_MSVC(4505) #if defined(PYBIND11_CPP20) # if __has_include() // __has_include has been part of C++17, no need to check it -# define PYBIND11_HAS_RANGES +# if !defined(PYBIND11_COMPILER_CLANG) +# define PYBIND11_HAS_RANGES +# else +# if __clang_major__ >= 16 // llvm/llvm-project#52696 +# define PYBIND11_HAS_RANGES +# endif +# endif # endif #endif