22 changes: 15 additions & 7 deletions clang/test/Sema/warn-documentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ int test_multiple_returns3(int);
int test_multiple_returns4(int);


/// expected-warning@+1 {{empty paragraph passed to '\retval' command}}
/// \retval 0
int test_retval_no_paragraph();

/// \retval 0 Everything is fine.
int test_retval_fine();


// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
/// \param a Blah blah.
int test_param1_backslash;
Expand Down Expand Up @@ -1108,49 +1116,49 @@ 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 a valid word argument}}
// expected-warning@+1 {{'\a' command has no word arguments, expected 1}}
/// \a
int test_inline_no_argument_a_bad(int);

/// \a A
int test_inline_no_argument_a_good(int);

// expected-warning@+1 {{'\anchor' command does not have a valid word argument}}
// expected-warning@+1 {{'\anchor' command has no word arguments, expected 1}}
/// \anchor
int test_inline_no_argument_anchor_bad(int);

/// \anchor A
int test_inline_no_argument_anchor_good(int);

// expected-warning@+1 {{'@b' command does not have a valid word argument}}
// expected-warning@+1 {{'@b' command has no word arguments, expected 1}}
/// @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 a valid word argument}}
// expected-warning@+1 {{'\c' command has no word arguments, expected 1}}
/// \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 a valid word argument}}
// expected-warning@+1 {{'\e' command has no word arguments, expected 1}}
/// \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 a valid word argument}}
// expected-warning@+1 {{'\em' command has no word arguments, expected 1}}
/// \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 a valid word argument}}
// expected-warning@+1 {{'\p' command has no word arguments, expected 1}}
/// \p
int test_inline_no_argument_p_bad(int);

Expand Down