Skip to content

Commit ff6bd09

Browse files
authored
Fix pybind11 interoperability with Clang trunk (pybind#1269)
1 parent add56cc commit ff6bd09

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/pybind11/cast.h

+3
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,9 @@ template <> inline void cast_safe<void>(object &&) {}
16851685

16861686
NAMESPACE_END(detail)
16871687

1688+
template <return_value_policy policy = return_value_policy::automatic_reference>
1689+
tuple make_tuple() { return tuple(0); }
1690+
16881691
template <return_value_policy policy = return_value_policy::automatic_reference,
16891692
typename... Args> tuple make_tuple(Args&&... args_) {
16901693
constexpr size_t size = sizeof...(Args);

include/pybind11/stl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
# define PYBIND11_HAS_OPTIONAL 1
3131
# endif
3232
// std::experimental::optional (but not allowed in c++11 mode)
33-
# if defined(PYBIND11_CPP14) && __has_include(<experimental/optional>)
33+
# if defined(PYBIND11_CPP14) && (__has_include(<experimental/optional>) && \
34+
!__has_include(<optional>))
3435
# include <experimental/optional>
3536
# define PYBIND11_HAS_EXP_OPTIONAL 1
3637
# endif

0 commit comments

Comments
 (0)