diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-09 10:34:37 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-09 10:34:37 (GMT) |
commit | 6c10868a2b31076e8f5e42af0036b43e7f39d2b2 (patch) | |
tree | af20c2e94106cbcae970c0f76f2b8f464e04073b /src/memberdef.cpp | |
parent | 911fad172a291a4dc4a55140ffa3d01fd81b9807 (diff) | |
download | Doxygen-6c10868a2b31076e8f5e42af0036b43e7f39d2b2.zip Doxygen-6c10868a2b31076e8f5e42af0036b43e7f39d2b2.tar.gz Doxygen-6c10868a2b31076e8f5e42af0036b43e7f39d2b2.tar.bz2 |
issue #7411: "warning: return type of member is not documented" for static void and virtual void functions
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r-- | src/memberdef.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 1c935ac..9e7fea6 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -4073,11 +4073,34 @@ void MemberDefImpl::warnIfUndocumented() const } } +static QCString removeReturnTypeKeywords(const QCString &s) +{ + QCString result = s; + bool done; + do + { + done=true; + if (result.stripPrefix("constexp ") || + result.stripPrefix("consteval ") || + result.stripPrefix("virtual ") || + result.stripPrefix("static ") || + result.stripPrefix("volatile ")) + { + done=false; + } + } + while (!done); + return result; +} + void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const { if (!Config_getBool(WARN_NO_PARAMDOC)) return; - QCString returnType = typeString(); + QCString returnType = removeReturnTypeKeywords(typeString()); bool isPython = getLanguage()==SrcLangExt_Python; + bool isFortran = getLanguage()==SrcLangExt_Fortran; + bool isFortranSubroutine = isFortran && returnType.find("subroutine")!=-1; + bool isVoidReturn = returnType=="void"; if (!m_impl->hasDocumentedParams && hasParamCommand) { @@ -4139,8 +4162,8 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn else if ( // see if return type is documented in a function w/o return type hasReturnCommand && ( - returnType=="void" || // void return type - returnType.find("subroutine")!=-1 || // fortran subroutine + isVoidReturn || // void return type + isFortranSubroutine || // fortran subroutine isConstructor() || // a constructor isDestructor() // or destructor ) @@ -4151,10 +4174,10 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn } else if ( // see if return needs to documented m_impl->hasDocumentedReturnType || - returnType=="void" || // void return type - returnType.find("subroutine")!=-1 || // fortran subroutine - isConstructor() || // a constructor - isDestructor() // or destructor + isVoidReturn || // void return type + isFortranSubroutine || // fortran subroutine + isConstructor() || // a constructor + isDestructor() // or destructor ) { m_impl->hasDocumentedReturnType = TRUE; |