diff options
author | Topi Reinio <topi.reinio@qt.io> | 2022-10-26 17:25:06 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2022-10-27 09:51:41 +0200 |
commit | f0bc24c06a56429468acefa1884dafe9793a9219 (patch) | |
tree | 6a26c6bfc758998b0a1a3a51327398318c039e75 /src/qdoc/clangcodeparser.cpp | |
parent | 8cd163a7356f18df1530fca4a21e30c197dd9b5d (diff) | |
download | qttools-f0bc24c06a56429468acefa1884dafe9793a9219.tar.gz |
qdoc: ClangCodeParser: Remove unnecessary global nodes from the tree
* Template argument deduction guides generate an entry in the Clang
AST at global scope; ignore
* Class constructors marked with constexpr generate a global instance;
ignore.
Pick-to: 6.4
Change-Id: I0cbee1d86baa705407cf2cf9e2d19b2e9b9f35d7
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 3cf930f36..8cb8a9056 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -457,6 +457,9 @@ private: // Ignore functions generated by property macros if (symbolName.startsWith("_qt_property_")) return true; + // Ignore template argument deduction guides + if (symbolName.startsWith("<deduction guide")) + return true; return false; } @@ -690,6 +693,9 @@ CXChildVisitResult ClangVisitor::visitHeader(CXCursor cursor, CXSourceLocation l QString name = functionName(cursor); if (ignoredSymbol(name)) return CXChildVisit_Continue; + // constexpr constructors generate also a global instance; ignore + if (kind == CXCursor_Constructor && parent_ == qdb_->primaryTreeRoot()) + return CXChildVisit_Continue; auto *fn = new FunctionNode(parent_, name); CXSourceRange range = clang_Cursor_getCommentRange(cursor); |