aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index f7c7f1292..96316b128 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -2709,14 +2709,15 @@ void AbstractMetaBuilderPrivate::inheritTemplateFunctions(AbstractMetaClass *sub
subclass->addFunction(f.take());
}
- const AbstractMetaFieldList &subClassFields = subclass->fields();
+ // Take copy
+ const AbstractMetaFieldList existingSubclassFields = subclass->fields();
const AbstractMetaFieldList &templateClassFields = templateClass->fields();
for (const AbstractMetaField *field : templateClassFields) {
// If the field is modified or the instantiation has a field named
// the same as an existing field we have shadowing, so we need to skip it.
if (field->isModifiedRemoved(TypeSystem::All)
|| field->attributes().testFlag(AbstractMetaAttributes::Static)
- || AbstractMetaField::find(subClassFields, field->name()) != nullptr) {
+ || AbstractMetaField::find(existingSubclassFields, field->name()) != nullptr) {
continue;
}