aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 6a3cb0fe9..b892d9392 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -1088,7 +1088,7 @@ void CppGenerator::writeVirtualMethodNative(TextStream &s,
continue;
const auto &argType = arg.type();
- auto argTypeEntry = static_cast<const PrimitiveTypeEntry *>(argType.typeEntry());
+ const auto *argTypeEntry = argType.typeEntry();
bool convert = argTypeEntry->isObject()
|| argTypeEntry->isValue()
|| argType.isValuePointer()
@@ -1099,9 +1099,10 @@ void CppGenerator::writeVirtualMethodNative(TextStream &s,
|| argType.referenceType() == LValueReference;
if (!convert && argTypeEntry->isPrimitive()) {
- if (argTypeEntry->basicReferencedTypeEntry())
- argTypeEntry = argTypeEntry->basicReferencedTypeEntry();
- convert = !formatUnits().contains(argTypeEntry->name());
+ const auto *pte = static_cast<const PrimitiveTypeEntry *>(argTypeEntry);
+ if (pte->basicReferencedTypeEntry())
+ pte = pte->basicReferencedTypeEntry();
+ convert = !formatUnits().contains(pte->name());
}
StringStream ac(TextStream::Language::Cpp);