diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-06 17:17:38 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-07 19:11:49 +0000 |
commit | d72f0e35f22f3f9460d12e40f8f5676bf5a7f0d1 (patch) | |
tree | c15bd1d472d4b0f1c3bf20794f3999317501f36c | |
parent | 89f5c75386c4ae7c439435e3e78fb7a22d76d3ad (diff) |
shiboken6: Fix inheriting template functions
562edc619787d83b2d4418fa7a69c597a7b6945c changing
AbstractMetaClass::functions() to return const-ref
introduced a bug causing inherited functions of the same name
to be rejected since they were added to the list.
Take a copy of the functions list to fix this.
Change-Id: I2f6182f45b13589f3495b1a4445c8004aadb4b95
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp index 6a40fe580..b4787ec9c 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp @@ -2740,13 +2740,14 @@ void AbstractMetaBuilderPrivate::inheritTemplateFunctions(AbstractMetaClass *sub } const auto &templateTypes = subclass->templateBaseClassInstantiations(); - const AbstractMetaFunctionList &subclassFuncs = subclass->functions(); + const AbstractMetaFunctionList existingSubclassFuncs = + subclass->functions(); // Take copy const AbstractMetaFunctionList &templateClassFunctions = templateClass->functions(); for (const AbstractMetaFunction *function : templateClassFunctions) { // If the function is modified or the instantiation has an equally named // function we have shadowing, so we need to skip it. if (function->isModifiedRemoved(TypeSystem::All) - || AbstractMetaFunction::find(subclassFuncs, function->name()) != nullptr) { + || AbstractMetaFunction::find(existingSubclassFuncs, function->name()) != nullptr) { continue; } |