summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2017-03-03 10:17:59 +0100
committerMartin Smith <martin.smith@qt.io>2017-08-10 07:34:42 +0000
commitb86d55979aa04b083d558814a4c17a526638d7d7 (patch)
tree3eb33170f5e45b1a66282e2e4a87f87871879155 /src/qdoc/cppcodeparser.cpp
parentd40aac3a115e5ac8cfc11df74384a4900959a962 (diff)
downloadqttools-b86d55979aa04b083d558814a4c17a526638d7d7.tar.gz
qdoc: Make qdoc handle ref qualifiers correctly
This update makes qdoc parse and record the presence of ref qualifiers on the end of function declarations. It unfortunately increases the number of qdoc errors reported in QtBase, but that is because these functions are not documented correctly. There will be another update to qdoc to allow documenting multiple functions with a single comment, which is needed for documenting these ref qualified functions but also can be useful in other contexts. Change-Id: If2efb1a71c683a465d66608a20e238d84ea45d9a Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 0cfde2c2c..219b39fbb 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -1519,6 +1519,12 @@ bool CppCodeParser::matchFunctionDecl(Aggregate *parent,
// look for const
bool matchedConst = match(Tok_const);
+ bool matchedRef = match(Tok_Ampersand);
+ bool matchedRefRef = false;
+ if (match(Tok_Ampersand)) {
+ matchedRef = false;
+ matchedRefRef = true;
+ }
bool matchFinal = match(Tok_final);
bool matchOverride = match(Tok_override);
@@ -1655,6 +1661,8 @@ bool CppCodeParser::matchFunctionDecl(Aggregate *parent,
func->setOverride(matchOverride);
if (isQPrivateSignal)
func->setPrivateSignal();
+ func->setRef(matchedRef);
+ func->setRefRef(matchedRefRef);
}
if (parentPathPtr != 0)
*parentPathPtr = parentPath;