aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
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 6eb7e7b0c..73b1aca63 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
@@ -59,6 +59,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));
@@ -972,7 +977,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);
}