diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-02-04 18:58:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-04 18:58:36 (GMT) |
commit | e60399016af7b72d5f8e2f4b2695591e5674ec5a (patch) | |
tree | b5a16bb6f42beaf47ebfcc92418a74400db32af8 | |
parent | 8a31e77445a94277151666380860defedcc3838d (diff) | |
parent | 2428c5ad6d971793a2942a0cf08a4b2449a98551 (diff) | |
download | Doxygen-e60399016af7b72d5f8e2f4b2695591e5674ec5a.zip Doxygen-e60399016af7b72d5f8e2f4b2695591e5674ec5a.tar.gz Doxygen-e60399016af7b72d5f8e2f4b2695591e5674ec5a.tar.bz2 |
Merge pull request #6788 from albert-github/feature/bug_void_return
Warning for documented return of void type function
-rw-r--r-- | src/docparser.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 20ee1f0..4b1ce94 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -616,16 +616,28 @@ static void detectNoDocumentedParams() g_memberDef->setHasDocumentedParams(TRUE); } } - //printf("Member %s hadDocumentedReturnType()=%d hasReturnCommand=%d\n", + //printf("Member %s hasDocumentedReturnType()=%d hasReturnCommand=%d\n", // g_memberDef->name().data(),g_memberDef->hasDocumentedReturnType(),g_hasReturnCommand); if (!g_memberDef->hasDocumentedReturnType() && // docs not yet found g_hasReturnCommand) { g_memberDef->setHasDocumentedReturnType(TRUE); } + else if ( // see if return type is documented in a function w/o return type + g_hasReturnCommand && + (//returnType.isEmpty() || // empty return type + returnType.find("void")!=-1 || // void return type + returnType.find("subroutine")!=-1 || // fortran subroutine + g_memberDef->isConstructor() || // a constructor + g_memberDef->isDestructor() // or destructor + ) + ) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"documented empty return type of %s",g_memberDef->qualifiedName().data()); + } else if ( // see if return needs to documented g_memberDef->hasDocumentedReturnType() || - returnType.isEmpty() || // empty return type + //returnType.isEmpty() || // empty return type returnType.find("void")!=-1 || // void return type returnType.find("subroutine")!=-1 || // fortran subroutine g_memberDef->isConstructor() || // a constructor @@ -634,18 +646,6 @@ static void detectNoDocumentedParams() { g_memberDef->setHasDocumentedReturnType(TRUE); } - else if ( // see if return type is documented in a function w/o return type - g_memberDef->hasDocumentedReturnType() && - (returnType.isEmpty() || // empty return type - returnType.find("void")!=-1 || // void return type - returnType.find("subroutine")!=-1 || // fortran subroutine - g_memberDef->isConstructor() || // a constructor - g_memberDef->isDestructor() // or destructor - ) - ) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"documented empty return type"); - } } } |