aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2')
-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"));