diff options
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 9ea7d9307..8d3179d5e 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -3018,7 +3018,19 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl if (func->isStatic()) continue; - const AbstractMetaType* type = func->arguments()[0]->type(); + QString typeReplaced = func->typeReplaced(1); + const AbstractMetaType* type = 0; + if (typeReplaced.isEmpty()) + type = func->arguments()[0]->type(); + else + type = buildAbstractMetaTypeFromString(typeReplaced); + + if (!type) { + ReportHandler::warning("Unknown type (" + typeReplaced + ") used in type replacement in function " + + func->signature() + ", the generated code will be broken !!!"); + continue; + } + bool numberType = alternativeNumericTypes == 1 || ShibokenGenerator::isPyInt(type); if (!comparesWithSameType) |