diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-09-12 18:18:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-12 18:18:59 (GMT) |
commit | 9826394521af43b38a6e228397328deaf793cd1e (patch) | |
tree | e06c7ea784d7ddfdf83ba6d3b73908fc966552fa /src | |
parent | b460ef7ff4f129142232df21a1aa4552ca3a3ee5 (diff) | |
parent | d6567641ef09bc125e3b722db7a202c12bf27913 (diff) | |
download | Doxygen-9826394521af43b38a6e228397328deaf793cd1e.zip Doxygen-9826394521af43b38a6e228397328deaf793cd1e.tar.gz Doxygen-9826394521af43b38a6e228397328deaf793cd1e.tar.bz2 |
Merge pull request #8014 from albert-github/feature/issue_6442
issue #6442 C++: Trailing return type syntax + void
Diffstat (limited to 'src')
-rw-r--r-- | src/memberdef.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 464dbd0..4951240 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -4050,6 +4050,18 @@ void MemberDefImpl::warnIfUndocumented() const warnIfUndocumentedParams(); } } +static QCString stripTrailingReturn(const QCString trailRet) +{ + QCString ret = trailRet; + + ret = ret.stripWhiteSpace(); + if (ret.startsWith("->")) + { + ret = ret.mid(2).stripWhiteSpace(); + return ret; + } + return trailRet; +} void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const { @@ -4058,7 +4070,17 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn bool isPython = getLanguage()==SrcLangExt_Python; bool isFortran = getLanguage()==SrcLangExt_Fortran; bool isFortranSubroutine = isFortran && returnType.find("subroutine")!=-1; + bool isVoidReturn = (returnType=="void") || (returnType.right(5)==" void"); + if (!isVoidReturn && returnType == "auto") + { + const ArgumentList &defArgList=isDocsForDefinition() ? argumentList() : declArgumentList(); + if (!defArgList.trailingReturnType().isEmpty()) + { + QCString strippedTrailingReturn = stripTrailingReturn(defArgList.trailingReturnType()); + isVoidReturn = (strippedTrailingReturn=="void") || (strippedTrailingReturn.right(5)==" void"); + } + } if (!m_impl->hasDocumentedParams && hasParamCommand) { |