提交 799d09ef 编写于 作者: M Megvii Engine Team

fix(imperative): fix compile error when vectorcall is enabled

GitOrigin-RevId: 7dda34a758dbb67a4f3f116d06b732219199366a
上级 a3b2232b
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
PyObject_HEAD PyObject_HEAD
std::aligned_storage_t<sizeof(T), alignof(T)> storage; std::aligned_storage_t<sizeof(T), alignof(T)> storage;
#ifdef _Py_TPFLAGS_HAVE_VECTORCALL #ifdef _Py_TPFLAGS_HAVE_VECTORCALL
PyObject* vectorcall_slot; PyObject* (*vectorcall_slot)(PyObject*, PyObject*const*, size_t, PyObject*);
#endif #endif
inline T* inst() { inline T* inst() {
...@@ -167,7 +167,7 @@ private: ...@@ -167,7 +167,7 @@ private:
struct tp_vectorcall { struct tp_vectorcall {
static constexpr bool valid = HAS_MEMBER(T, tp_vectorcall); static constexpr bool valid = HAS_MEMBER(T, tp_vectorcall);
static constexpr bool haskw = [](){if constexpr (valid) static constexpr bool haskw = [](){if constexpr (valid)
if constexpr (std::is_invocable_v<T::tp_vectorcall, T, PyObject*const*, size_t, PyObject*>) if constexpr (std::is_invocable_v<decltype(&T::tp_vectorcall), T, PyObject*const*, size_t, PyObject*>)
return true; return true;
return false;}(); return false;}();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册