diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-18 13:22:20 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-18 16:03:32 +0200 |
| commit | a1569c142dc3a357ac6232925bfb0b4d84e29e5a (patch) | |
| tree | 58daded589d28e300a71868365e4dcbea4aec497 /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | |
| parent | 3c005da473fa0b1b399e9d8aab98cfd7aa420754 (diff) | |
shiboken6: Handle enums without values
shiboken used to ignore enumerations without values assuming they were
just forward declaration of an enum classes. It turns out that there
are such cases (QCborTag). To fix this, add empty enums always and
replace them by the ones with values.
Task-number: PYSIDE-1691
Pick-to: 6.2
Change-Id: I5de69f86ed45bd9f239e6d6017e7dc4a554f5378
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp index 3ef826deb..b968cf0ad 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp @@ -1240,9 +1240,7 @@ bool Builder::endToken(const CXCursor &cursor) d->m_currentFunctionType = CodeModel::Normal; break; case CXCursor_EnumDecl: - // Add enum only if values were encountered, otherwise assume it - // is a forward declaration of an enum class. - if (!d->m_currentEnum.isNull() && d->m_currentEnum->hasValues()) + if (!d->m_currentEnum.isNull()) d->m_scopeStack.back()->addEnum(d->m_currentEnum); d->m_currentEnum.clear(); break; |
