summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-08-20 08:36:21 +0000
committerStephan Bergmann <sbergman@redhat.com>2019-08-20 08:36:21 +0000
commit982b105d2f33abb89f0b25bee652afc049f2d38c (patch)
treed05e421fdd7dc72a60992de6059f088658fb6022
parentf66b767abe5edcdd7ab4a25007b71437f58c1369 (diff)
downloadbcm5719-llvm-982b105d2f33abb89f0b25bee652afc049f2d38c.tar.gz
bcm5719-llvm-982b105d2f33abb89f0b25bee652afc049f2d38c.zip
Rudimentary support for Doxygen \retval command
...so that at least a preceding \param etc. that lacks a description gets a -Wdocumentation warning (instead of erroneously treating the \retval ... text as its paragraph). Differential Revision: https://reviews.llvm.org/D66350 llvm-svn: 369345
-rw-r--r--clang/include/clang/AST/CommentCommands.td1
-rw-r--r--clang/test/Sema/warn-documentation.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td
index 958ee032e71..3b0d1603d40 100644
--- a/clang/include/clang/AST/CommentCommands.td
+++ b/clang/include/clang/AST/CommentCommands.td
@@ -139,6 +139,7 @@ def Post : BlockCommand<"post">;
def Pre : BlockCommand<"pre">;
def Remark : BlockCommand<"remark">;
def Remarks : BlockCommand<"remarks">;
+def Retval : BlockCommand<"retval">;
def Sa : BlockCommand<"sa">;
def See : BlockCommand<"see">;
def Since : BlockCommand<"since">;
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp
index df7e189514a..ecda6dd57c4 100644
--- a/clang/test/Sema/warn-documentation.cpp
+++ b/clang/test/Sema/warn-documentation.cpp
@@ -288,6 +288,11 @@ int test_param21(int a);
/// \param x2 Ccc.
int test_param22(int x1, int x2, int x3);
+// expected-warning@+1 {{empty paragraph passed to '\param' command}}
+/// \param a
+/// \retval 0 Blah blah.
+int test_param23(int a);
+
//===---
// Test that we treat typedefs to some non-function types as functions for the
// purposes of documentation comment parsing.
OpenPOWER on IntegriCloud