From 4c01d4729efab93c9bebabd553b3ed6a13795d00 Mon Sep 17 00:00:00 2001 From: jiwaszki Date: Mon, 19 Sep 2022 19:27:50 +0200 Subject: [PATCH 1/2] Fix for windows compiler, missing object initializer --- 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 9e6947daa3..ce5c304fcb 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -1037,7 +1037,7 @@ template || (defined(__clang__) && __clang_major__ == 5) static constexpr detail::overload_cast_impl overload_cast = {}; # else -static constexpr detail::overload_cast_impl overload_cast; +static constexpr detail::overload_cast_impl overload_cast{}; # endif #endif From cef7a44fc83dd9d4e648c1073c99a93ece8a250c Mon Sep 17 00:00:00 2001 From: jiwaszki Date: Tue, 20 Sep 2022 12:11:12 +0200 Subject: [PATCH 2/2] Removal of if-else macro for MSVC --- include/pybind11/detail/common.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index ce5c304fcb..6da7ef859c 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -1033,12 +1033,7 @@ PYBIND11_NAMESPACE_END(detail) /// - regular: static_cast(&Class::func) /// - sweet: overload_cast(&Class::func) template -# if (defined(_MSC_VER) && _MSC_VER < 1920) /* MSVC 2017 */ \ - || (defined(__clang__) && __clang_major__ == 5) -static constexpr detail::overload_cast_impl overload_cast = {}; -# else static constexpr detail::overload_cast_impl overload_cast{}; -# endif #endif /// Const member function selector for overload_cast