From 989f3e62560104a90c1e99714a72b6ade2d61ce9 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 31 Aug 2020 15:15:52 +0800 Subject: [PATCH] chore(mge/imperative): workaround a gcc-7 bug GitOrigin-RevId: 638683a5f7a9b333676110b6beb8f30e28117d10 --- imperative/python/src/pyext17.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imperative/python/src/pyext17.h b/imperative/python/src/pyext17.h index c28a474d..41512e16 100644 --- a/imperative/python/src/pyext17.h +++ b/imperative/python/src/pyext17.h @@ -264,8 +264,8 @@ public: TypeBuilder& operator=(const TypeBuilder&) = delete; TypeBuilder() : m_type{PyVarObject_HEAD_INIT(nullptr, 0)} { - // static_assert(HAS_MEMBER(T, tp_name)); - if constexpr (HAS_MEMBER(T, tp_name)) { + constexpr auto has_tp_name = HAS_MEMBER(T, tp_name); + if constexpr (has_tp_name) { m_type.tp_name = T::tp_name; } m_type.tp_dealloc = tp_dealloc::value;