diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-07-01 09:53:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-07-01 16:19:00 +0200 |
commit | f0db6d8ccdf77dab462ea299b497bbfdabcff515 (patch) | |
tree | f392cde30d4ee51c920c5be8608a3aaf45cbd05f /sources/shiboken6/generator/shiboken/cppgenerator.cpp | |
parent | 6d81913ed1189a5c7b1e26d2456f05e8e8684914 (diff) |
Fix compilation of unique pointer converters for derived classes
Add a std::move() to the converter.
Also add a test, which currently still fails. The pointer
needs to be moved back after the call.
Task-number: PYSIDE-454
Change-Id: I173d1becdbac53739923ddbce8a8cdc4f203ccea
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 884a531f6..c23c24590 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -3422,7 +3422,9 @@ void CppGenerator::writePythonToCppConversionFunctions(TextStream &s, ? targetType.cppSignature() : getFullTypeName(targetType.typeEntry()); c << "*reinterpret_cast<" << fullTypeName << " *>(cppOut) = " - << fullTypeName << '(' << conversion << ");"; + << fullTypeName << '(' + << (sourceType.isUniquePointer() ? stdMove(conversion) : conversion) + << ");"; QString sourceTypeName = fixedCppTypeName(sourceType); QString targetTypeName = fixedCppTypeName(targetType); writePythonToCppFunction(s, c.toString(), sourceTypeName, targetTypeName); |