]> granicus.if.org Git - clang/commitdiff
Rudimentary support for Doxygen \retval command
authorStephan Bergmann <sbergman@redhat.com>
Tue, 20 Aug 2019 08:36:21 +0000 (08:36 +0000)
committerStephan Bergmann <sbergman@redhat.com>
Tue, 20 Aug 2019 08:36:21 +0000 (08:36 +0000)
...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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369345 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/CommentCommands.td
test/Sema/warn-documentation.cpp

index 958ee032e71fd0ea73190b572f78f18ea69140a9..3b0d1603d407c045da3df8c619dc08a5de5bf5a4 100644 (file)
@@ -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">;
index df7e189514aa06366b0972dc9ff1f5d4bf630ac1..ecda6dd57c48acae15435485831fbc1b158d00ac 100644 (file)
@@ -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.