summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2017-04-05 10:59:10 +0200
committerMartin Smith <martin.smith@qt.io>2017-08-10 07:35:28 +0000
commit290aeb761e0dfab20f730724925fa2c19280a6b0 (patch)
tree283007564c0e1a05477c0bcee69f26561d227ed0 /src/qdoc/clangcodeparser.cpp
parentaf61f06b32714a0840b0373cbf025e7cf00af270 (diff)
downloadqttools-290aeb761e0dfab20f730724925fa2c19280a6b0.tar.gz
qdoc: Ignore declarations of anonymous structs
qdoc doesn't need to see declarations of anonymous structs. When it does see one inside a class or struct that is named, then the html generator tries to overwrite the html file for the outer class or struct. That causes a few qdoc error messages and it overwrites the html file for the class reference page and the all-members page. This update tells clang not to visit the declaration of the anonymous struct, so the html generator doesn't see it as something to be documented. Change-Id: Ie8c732e650c39f78c1374523d72a7e0448a31ba3 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 6d55a1a13..18727ebde 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -400,6 +400,8 @@ CXChildVisitResult ClangVisitor::visitHeader(CXCursor cursor, CXSourceLocation l
}
case CXCursor_StructDecl:
case CXCursor_UnionDecl:
+ if (fromCXString(clang_getCursorSpelling(cursor)).isEmpty()) // anonymous struct or union
+ return CXChildVisit_Continue;
case CXCursor_ClassDecl:
case CXCursor_ClassTemplate: {