[PyQt] Diamond Inheritance with SIP 4.19.15

Scott Talbert swt at techie.net
Fri Apr 5 02:54:29 BST 2019


I'm seeing a compilation error when trying to compile wxPython 4 with SIP 
4.19.15 (4.19.14 works):

../../../../sip/cpp/sip_corewxVarHVScrollHelper.cpp: In function ‘void* 
cast_wxVarHVScrollHelper(void*, const sipTypeDef*)’:
../../../../sip/cpp/sip_corewxVarHVScrollHelper.cpp:1332:62: error: 
‘wxVarScrollHelperBase’ is an ambiguous base of ‘wxVarHVScrollHelper’
          return static_cast< ::wxVarScrollHelperBase *>(sipCpp);
                                                               ^

This is the class inheritance diagram:

//                  wxVarScrollHelperBase                       |
//                   /                 \                        |
//                  /                   \                       |
//                 V                     V                      |
//  wxVarHScrollHelper                 wxVarVScrollHelper       |
//       |          \                   /           |           |
//       |           \                 /            |           |
//       |            V               V             |           |
//       |           wxVarHVScrollHelper            |           |

This is the body of cast_wxVarHVScrollHelper generated by SIP 4.19.14:

static void *cast_wxVarHVScrollHelper(void *sipCppV, const sipTypeDef 
*targetType)
{
      ::wxVarHVScrollHelper *sipCpp = reinterpret_cast< 
::wxVarHVScrollHelper *>(sipCppV);

     if (targetType == sipType_wxVarVScrollHelper)
         return static_cast< ::wxVarVScrollHelper *>(sipCpp);

     if (targetType == sipType_wxVarHScrollHelper)
         return static_cast< ::wxVarHScrollHelper *>(sipCpp);

     return sipCppV;
}

This is the body of cast_wxVarHVScrollHelper generated with SIP 4.19.15:

static void *cast_wxVarHVScrollHelper(void *sipCppV, const sipTypeDef 
*targetType)
{
      ::wxVarHVScrollHelper *sipCpp = reinterpret_cast< 
::wxVarHVScrollHelper *>(sipCppV);

     if (targetType == sipType_wxVarVScrollHelper)
         return static_cast< ::wxVarVScrollHelper *>(sipCpp);

     if (targetType == sipType_wxVarScrollHelperBase)
         return static_cast< ::wxVarScrollHelperBase *>(sipCpp);

     if (targetType == sipType_wxVarHScrollHelper)
         return static_cast< ::wxVarHScrollHelper *>(sipCpp);

     return sipCppV;
}

It seems that SIP should not be trying to cast to wxVarScrollHelperBase.

Scott


More information about the PyQt mailing list