From ff6bd092d482b0c4e51aeb7367c3e5ecbc18a9de Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 6 Feb 2018 15:40:50 +0100 Subject: [PATCH] Fix pybind11 interoperability with Clang trunk (#1269) --- include/pybind11/cast.h | 3 +++ include/pybind11/stl.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 0aa632601..3ec6f7288 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1685,6 +1685,9 @@ template <> inline void cast_safe(object &&) {} NAMESPACE_END(detail) +template +tuple make_tuple() { return tuple(0); } + template tuple make_tuple(Args&&... args_) { constexpr size_t size = sizeof...(Args); diff --git a/include/pybind11/stl.h b/include/pybind11/stl.h index e690e43fa..eb4c812c6 100644 --- a/include/pybind11/stl.h +++ b/include/pybind11/stl.h @@ -30,7 +30,8 @@ # define PYBIND11_HAS_OPTIONAL 1 # endif // std::experimental::optional (but not allowed in c++11 mode) -# if defined(PYBIND11_CPP14) && __has_include() +# if defined(PYBIND11_CPP14) && (__has_include() && \ + !__has_include()) # include # define PYBIND11_HAS_EXP_OPTIONAL 1 # endif