Skip to content

Commit

Permalink
docparser: warn when finding a documented empty return type
Browse files Browse the repository at this point in the history
There is an example on pg24 of [1] where a libclang based comment parser
emits a warning for a documented empty return type.

[1] "Parsing Documentation Comments in Clang" http://llvm.org/devmtg/2012-11/Gribenko_CommentParsing.pdf
  • Loading branch information
groleo committed Jun 21, 2015
1 parent f63d9ed commit 10989e2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,18 @@ static void detectNoDocumentedParams()
{
g_memberDef->setHasDocumentedReturnType(TRUE);
}

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");
}
}
}

Expand Down

0 comments on commit 10989e2

Please sign in to comment.