From 3ed62218a8803e606d57e8589c2d5dc5cf61bfff Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 27 Jul 2017 20:17:05 -0400 Subject: [PATCH] overload_cast MSVC 2015 fix The current `py::overload_cast` is hitting some ICEs under both MSVC 2015 and clang 3.8 on debian with the rewritten test suites; adding an empty constexpr constructor to the `overload_cast_impl` class seems to avoid the ICE. --- include/pybind11/common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 50c09592..dc50b7cf 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -799,6 +799,8 @@ struct nodelete { template void operator()(T*) { } }; NAMESPACE_BEGIN(detail) template struct overload_cast_impl { + constexpr overload_cast_impl() {} // MSVC 2015 needs this + template constexpr auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf) { return pf; }