diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-06-13 09:52:53 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-06-15 19:59:10 +0200 |
| commit | e4cd729f752fab69e01993d304bd73cd7fe41baa (patch) | |
| tree | 058f34fbfc865b1e97828e3ce34de163af72df76 /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | |
| parent | 9c7f990f8d2d71650b11c6913c4d7c4118eccad6 (diff) | |
shiboken6: Fix determining unsigned enum values for enums with typedefs as underlying types
In case of enums with typedefs as underlying types, for example:
enum GlyphRunRetrievalFlag : quint16 {
RetrieveAll = 0xffff
the unsignedness-detection would fail. Add helper functions to fully
resolve typedefs for this case.
Pick-to: 6.5
Task-number: PYSIDE-1735
Change-Id: Ib42c4a5b34cb576a8246f4734d4ae8dacb9ac2e7
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp index 1bc742ae7..3a9dfde40 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp @@ -946,7 +946,8 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor) d->m_currentEnum->setEnumKind(kind); if (clang_getCursorAvailability(cursor) == CXAvailability_Deprecated) d->m_currentEnum->setDeprecated(true); - d->m_currentEnum->setSigned(isSigned(clang_getEnumDeclIntegerType(cursor).kind)); + const auto enumType = fullyResolveType(clang_getEnumDeclIntegerType(cursor)); + d->m_currentEnum->setSigned(isSigned(enumType.kind)); if (std::dynamic_pointer_cast<_ClassModelItem>(d->m_scopeStack.back())) d->m_currentEnum->setAccessPolicy(accessPolicy(clang_getCXXAccessSpecifier(cursor))); } |
