aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-14 12:11:28 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-18 15:13:34 +0200
commitdc9c6f502e82105dd4c4cc5f3aca5915ed163910 (patch)
tree83947f2248860b2734559671b3aef6e2a099b650 /sources/shiboken2/generator
parent0c6e4506e5c0b6aacdf48fd777eb452d91732157 (diff)
shiboken: Add an internal error when template instantiations are not found
Happens in Qt 6 for QItemSelection. Task-number: PYSIDE-904 Change-Id: Id2463eeb046155615d3d356b3cf38b32cb5c15e5 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 2d3182874..28c7bf320 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -6080,7 +6080,12 @@ void CppGenerator::writeStdListWrapperMethods(QTextStream &s, const GeneratorCon
s << INDENT << metaClass->qualifiedCppName() << "::iterator _item = " << CPP_SELF_VAR << "->begin();\n";
s << INDENT << "for (Py_ssize_t pos = 0; pos < _i; pos++) _item++;\n";
- const AbstractMetaType *itemType = metaClass->templateBaseClassInstantiations().constFirst();
+ const AbstractMetaTypeList instantiations = metaClass->templateBaseClassInstantiations();
+ if (instantiations.isEmpty()) {
+ qFatal("shiboken: %s: Internal error, no instantiations of \"%s\" were found.",
+ __FUNCTION__, qPrintable(metaClass->qualifiedCppName()));
+ }
+ const AbstractMetaType *itemType = instantiations.constFirst();
s << INDENT << "return ";
writeToPythonConversion(s, itemType, metaClass, QLatin1String("*_item"));