summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authorAdrian Negreanu <adrian.m.negreanu@intel.com>2015-06-11 06:10:10 (GMT)
committerAdrian Negreanu <adrian.m.negreanu@intel.com>2015-06-21 05:45:49 (GMT)
commit10989e2dade3bb35a421787c5315d2630d665842 (patch)
tree1f20533514b6ef6512c8fbbcea10b7b7b26da13f /src/docparser.cpp
parentf63d9ed958d2c06717434e1a90e6417cf2d60f6b (diff)
downloadDoxygen-10989e2dade3bb35a421787c5315d2630d665842.zip
Doxygen-10989e2dade3bb35a421787c5315d2630d665842.tar.gz
Doxygen-10989e2dade3bb35a421787c5315d2630d665842.tar.bz2
docparser: warn when finding a documented empty return type
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
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index f4261ac..0613ccf 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -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");
+ }
}
}