aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-22 08:22:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-22 08:22:42 +0200
commit17a20f95151368a3b92b949b905325865643ca45 (patch)
tree2271f52498f0dfe7bac57888af7c56b85c3d9e02 /sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
parent98eb59226aca550ae086c00b9c8023f47c44d2b2 (diff)
parent936cc4c72e2393ed59e05dca1100150d88b52645 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
index e134ebcfe..944445579 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
@@ -56,6 +56,11 @@ static inline bool isClassCursor(const CXCursor &c)
|| c.kind == CXCursor_ClassTemplatePartialSpecialization;
}
+static inline bool isClassOrNamespaceCursor(const CXCursor &c)
+{
+ return c.kind == CXCursor_Namespace || isClassCursor(c);
+}
+
static inline bool withinClassDeclaration(const CXCursor &cursor)
{
return isClassCursor(clang_getCursorLexicalParent(cursor));
@@ -979,7 +984,7 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
break;
case CXCursor_VarDecl:
// static class members are seen as CXCursor_VarDecl
- if (!d->m_currentClass.isNull() && isClassCursor(clang_getCursorSemanticParent(cursor))) {
+ if (isClassOrNamespaceCursor(clang_getCursorSemanticParent(cursor))) {
d->addField(cursor);
d->m_currentField->setStatic(true);
}