From a1127594d85bd1155353eb873e598edcc4869918 Mon Sep 17 00:00:00 2001
From: Xavier Thompson <xavier.thompson@nexedi.com>
Date: Wed, 9 Sep 2020 15:18:55 +0200
Subject: [PATCH] Fix Cy_Ref cypclass smart pointer metafunction causing
 'incomplete type' compilation error

---
 Cython/Utility/CyObjects.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/Cython/Utility/CyObjects.cpp b/Cython/Utility/CyObjects.cpp
index e108294c9..8effe2a40 100644
--- a/Cython/Utility/CyObjects.cpp
+++ b/Cython/Utility/CyObjects.cpp
@@ -256,17 +256,14 @@
         };
         }
 
-        template <typename T, bool = std::is_convertible<T*, CyObject*>::value>
-        struct Cy_Ref_t {};
-
         template <typename T>
-        struct Cy_Ref_t<T, true> {
+        struct Cy_Ref_t {
             using type = Cy_Ref_impl<T>;
         };
 
         template <typename T>
-        struct Cy_Ref_t<T, false> {
-            using type = T;
+        struct Cy_Ref_t<Cy_Ref_impl<T>> {
+            using type = Cy_Ref_impl<T>;
         };
 
         template <typename T>
-- 
2.30.9