summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-11-03 19:28:19 +0100
committerMartin Smith <martin.smith@qt.io>2017-08-10 07:33:13 +0000
commit48063f1f1f016f940b240445e1144d05c2e8e92d (patch)
treebda9e237746aa21365f4d71a895f0d9c36d491d0 /src/qdoc/clangcodeparser.cpp
parentc95cba39a68bea4dc4c3c003e768412f0640e24f (diff)
downloadqttools-48063f1f1f016f940b240445e1144d05c2e8e92d.tar.gz
qdoc: Parse Friend declarations
(Requires clang 4.0) Change-Id: I50240f0e4b9f538c65dbaa0e8d08469676ac9012 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index ef9483a00..25d268c0e 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -488,6 +488,17 @@ CXChildVisitResult ClangVisitor::visitHeader(CXCursor cursor, CXSourceLocation l
readParameterNamesAndAttributes(fn, cursor);
return CXChildVisit_Continue;
}
+#if CINDEX_VERSION >= 36
+ case CXCursor_FriendDecl: {
+ // Friend functions are declared in the enclosing namespace
+ Aggregate *ns = parent_;
+ while (ns && ns->isClass())
+ ns = ns->parent();
+ QScopedValueRollback<Aggregate *> setParent(parent_, ns);
+ // Visit the friend functions
+ return visitChildren(cursor);
+ }
+#endif
case CXCursor_EnumDecl: {
if (findNodeForCursor(qdb_, cursor)) // Was already parsed, propably in another translation unit
return CXChildVisit_Continue;