diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2019-08-05 08:05:16 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2019-08-05 08:05:16 +0000 |
| commit | 657330ee0e41b90fa7f7b55fb7caa11f9c2c5369 (patch) | |
| tree | d4e0af1f4fd06d85d686fef679e185b0dd78ee7c /clang/test/Sema/warn-documentation.cpp | |
| parent | 97ccf6b8c17d4837a413627af6db283a6a1bf162 (diff) | |
| download | bcm5719-llvm-657330ee0e41b90fa7f7b55fb7caa11f9c2c5369.tar.gz bcm5719-llvm-657330ee0e41b90fa7f7b55fb7caa11f9c2c5369.zip | |
Adds a warning when an inline Doxygen comment has no argument
Summary:
It warns for for comments like
/** \pre \em */
where \em has no argument
This warning is enabled with the -Wdocumentation option.
Reviewers: gribozavr, rsmith
Reviewed By: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64696
Patch by Mark de Wever.
llvm-svn: 367809
Diffstat (limited to 'clang/test/Sema/warn-documentation.cpp')
| -rw-r--r-- | clang/test/Sema/warn-documentation.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp index 5083f686338..df7e189514a 100644 --- a/clang/test/Sema/warn-documentation.cpp +++ b/clang/test/Sema/warn-documentation.cpp @@ -1044,6 +1044,48 @@ template <> template <typename B> void test_attach38<int>::test_attach39(int, B); +// The inline comments expect a string after the command. +// expected-warning@+1 {{'\a' command does not have an argument}} +/// \a +int test_inline_no_argument_a_bad(int); + +/// \a A +int test_inline_no_argument_a_good(int); + +// expected-warning@+1 {{'@b' command does not have an argument}} +/// @b +int test_inline_no_argument_b_bad(int); + +/// @b A +int test_inline_no_argument_b_good(int); + +// expected-warning@+1 {{'\c' command does not have an argument}} +/// \c +int test_inline_no_argument_c_bad(int); + +/// \c A +int test_inline_no_argument_c_good(int); + +// expected-warning@+1 {{'\e' command does not have an argument}} +/// \e +int test_inline_no_argument_e_bad(int); + +/// \e A +int test_inline_no_argument_e_good(int); + +// expected-warning@+1 {{'\em' command does not have an argument}} +/// \em +int test_inline_no_argument_em_bad(int); + +/// \em A +int test_inline_no_argument_em_good(int); + +// expected-warning@+1 {{'\p' command does not have an argument}} +/// \p +int test_inline_no_argument_p_bad(int); + +/// \p A +int test_inline_no_argument_p_good(int); // PR13411, reduced. We used to crash on this. /** |

