Skip to content

Commit a54c236

Browse files
committed
Work around issue with macro + parameter packs in clang v6 and v7
1 parent 8a9e8ea commit a54c236

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

c++/cpp2py/converters/tuple.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ namespace cpp2py {
4848
// -----------------------------------------
4949

5050
private:
51+
52+
// Helper function needed due to clang v6 and v7 parameter pack issue
53+
static auto py_seq_fast_get_item(PyObject *seq, Py_ssize_t i) {
54+
return PySequence_Fast_GET_ITEM(seq, i);
55+
}
56+
5157
// is_convertible implementation
5258
template <auto... Is> static bool is_convertible_impl(PyObject *seq, bool raise_exception, std::index_sequence<Is...>) {
53-
return (py_converter<std::decay_t<Types>>::is_convertible(PySequence_Fast_GET_ITEM(seq, Is), raise_exception) and ...);
59+
return (py_converter<std::decay_t<Types>>::is_convertible(py_seq_fast_get_item(seq, Is), raise_exception) and ...);
5460
}
5561

5662
public:
@@ -72,7 +78,7 @@ namespace cpp2py {
7278

7379
private:
7480
template <auto... Is> static auto py2c_impl(PyObject *seq, std::index_sequence<Is...>) {
75-
return std::make_tuple(py_converter<std::decay_t<Types>>::py2c(PySequence_Fast_GET_ITEM(seq, Is))...);
81+
return std::make_tuple(py_converter<std::decay_t<Types>>::py2c(py_seq_fast_get_item(seq, Is))...);
7682
}
7783

7884
public:

0 commit comments

Comments
 (0)