diff options
author | Martin Smith <martin.smith@qt.io> | 2017-03-03 10:17:59 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2017-08-10 07:34:42 +0000 |
commit | b86d55979aa04b083d558814a4c17a526638d7d7 (patch) | |
tree | 3eb33170f5e45b1a66282e2e4a87f87871879155 /src/qdoc/clangcodeparser.cpp | |
parent | d40aac3a115e5ac8cfc11df74384a4900959a962 (diff) | |
download | qttools-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/clangcodeparser.cpp')
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 65c9b6d14..22ea7cf5d 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -491,6 +491,11 @@ CXChildVisitResult ClangVisitor::visitHeader(CXCursor cursor, CXSourceLocation l fn->setVirtualness(!clang_CXXMethod_isVirtual(cursor) ? FunctionNode::NonVirtual : clang_CXXMethod_isPureVirtual(cursor) ? FunctionNode::PureVirtual : FunctionNode::NormalVirtual); + CXRefQualifierKind refQualKind = clang_Type_getCXXRefQualifier(funcType); + if (refQualKind == CXRefQualifier_LValue) + fn->setRef(true); + else if (refQualKind == CXRefQualifier_RValue) + fn->setRefRef(true); // For virtual functions, determine what it overrides // (except for destructor for which we do not want to classify as overridden) if (!fn->isNonvirtual() && kind != CXCursor_Destructor) { |