From 6e77dec18651a023b8447ed7ce64c2a1db6e2462 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 13 Jun 2019 15:55:24 +0200 Subject: shiboken: Generate code for smart pointers only within declaring package Check on the type entry whether code needs to be generated in the current package. Fixes: PYSIDE-1024 Change-Id: I82132b077ac6192b96d979cb5596d0e6fecbc76b Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/generator/generator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sources') diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp index 46ad90724..49064a6a5 100644 --- a/sources/shiboken2/generator/generator.cpp +++ b/sources/shiboken2/generator/generator.cpp @@ -219,9 +219,12 @@ void Generator::addInstantiatedContainersAndSmartPointers(const AbstractMetaType const AbstractMetaTypeList &instantiations = type->instantiations(); for (const AbstractMetaType* t : instantiations) addInstantiatedContainersAndSmartPointers(t, context); - if (!type->typeEntry()->isContainer() && !type->typeEntry()->isSmartPointer()) + const auto typeEntry = type->typeEntry(); + const bool isContainer = typeEntry->isContainer(); + if (!isContainer + && !(typeEntry->isSmartPointer() && typeEntry->generateCode())) { return; - bool isContainer = type->typeEntry()->isContainer(); + } if (type->hasTemplateChildren()) { QString piece = isContainer ? QStringLiteral("container") : QStringLiteral("smart pointer"); QString warning = -- cgit v1.2.3