diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-27 12:44:10 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-28 10:55:56 +0200 |
| commit | 075d8ad4660f05e6d2583ff1c05e9987ad624bfe (patch) | |
| tree | 4c8dca98e7502180435f66a6904f30d4434989a7 /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | |
| parent | 9203d7f88071797d72ef057a68ab160a28160277 (diff) | |
shiboken6/clang: Record scope resolution of arguments/function return
Add a flag indicating whether a type was specified with a leading "::"
(scope resolution). Such parameters previously caused the function to
rejected due to the "::TypeName" not being found. The type resolution
added for clang 16 strips these qualifiers though, so, the information
needs to be stored.
Task-number: PYSIDE-2288
Pick-to: 6.5 5.15
Change-Id: I27d27c94ec43bcc4cb3b79e6e9ce6706c749a1e9
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp index b86ebc043..1bc742ae7 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp @@ -323,7 +323,9 @@ FunctionModelItem BuilderPrivate::createFunction(const CXCursor &cursor, name = fixTypeName(name); auto result = std::make_shared<_FunctionModelItem>(m_model, name); setFileName(cursor, result.get()); - result->setType(createTypeInfo(clang_getCursorResultType(cursor))); + const auto type = clang_getCursorResultType(cursor); + result->setType(createTypeInfo(type)); + result->setScopeResolution(hasScopeResolution(type)); result->setFunctionType(t); result->setScope(m_scope); result->setStatic(clang_Cursor_getStorageClass(cursor) == CX_SC_Static); @@ -1059,7 +1061,9 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor) if (!d->m_currentArgument && d->m_currentFunction) { const QString name = getCursorSpelling(cursor); d->m_currentArgument.reset(new _ArgumentModelItem(d->m_model, name)); - d->m_currentArgument->setType(d->createTypeInfo(cursor)); + const auto type = clang_getCursorType(cursor); + d->m_currentArgument->setScopeResolution(hasScopeResolution(type)); + d->m_currentArgument->setType(d->createTypeInfo(type)); d->m_currentFunction->addArgument(d->m_currentArgument); QString defaultValueExpression = d->cursorValueExpression(this, cursor); if (!defaultValueExpression.isEmpty()) { |
