Skip to content

Commit 982b105

Browse files
committedAug 20, 2019
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
1 parent f66b767 commit 982b105

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎clang/include/clang/AST/CommentCommands.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def Post : BlockCommand<"post">;
139139
def Pre : BlockCommand<"pre">;
140140
def Remark : BlockCommand<"remark">;
141141
def Remarks : BlockCommand<"remarks">;
142+
def Retval : BlockCommand<"retval">;
142143
def Sa : BlockCommand<"sa">;
143144
def See : BlockCommand<"see">;
144145
def Since : BlockCommand<"since">;

‎clang/test/Sema/warn-documentation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ int test_param21(int a);
288288
/// \param x2 Ccc.
289289
int test_param22(int x1, int x2, int x3);
290290

291+
// expected-warning@+1 {{empty paragraph passed to '\param' command}}
292+
/// \param a
293+
/// \retval 0 Blah blah.
294+
int test_param23(int a);
295+
291296
//===---
292297
// Test that we treat typedefs to some non-function types as functions for the
293298
// purposes of documentation comment parsing.

0 commit comments

Comments
 (0)
Please sign in to comment.