1 | // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -verify %s |
2 | // rdar://12390371 |
3 | |
4 | /** @return s Test*/ |
5 | struct s* f(void); |
6 | struct s; |
7 | |
8 | struct s1; |
9 | /** @return s1 Test 1*/ |
10 | struct s1* f1(void); |
11 | |
12 | struct s2; |
13 | /** @return s2 Test 2*/ |
14 | struct s2* f2(void); |
15 | struct s2; |
16 | |
17 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
18 | /** @return s3 Test 3 - expected warning here */ |
19 | struct s3; |
20 | struct s3* f3(void); |
21 | |
22 | /** @return s4 Test 4 */ |
23 | struct s4* f4(void); |
24 | struct s4 { int is; }; |
25 | |
26 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
27 | /** @return s5 Test 5 - expected warning here */ |
28 | struct s5 { int is; }; |
29 | struct s5* f5(void); |
30 | |
31 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
32 | /** @return s6 Test 6 - expected warning here */ |
33 | struct s6 *ps6; |
34 | struct s6* f6(void); |
35 | |
36 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
37 | /** @return s7 Test 7 - expected warning here */ |
38 | struct s7; |
39 | struct s7* f7(void); |
40 | |
41 | struct s8 { int is8; }; |
42 | /** @return s8 Test 8 */ |
43 | struct s4 *f8(struct s8 *p); |
44 | |
45 | |
46 | /** @return e Test*/ |
47 | enum e* g(void); |
48 | enum e; |
49 | |
50 | enum e1; |
51 | /** @return e1 Test 1*/ |
52 | enum e1* g1(void); |
53 | |
54 | enum e2; |
55 | /** @return e2 Test 2*/ |
56 | enum e2* g2(void); |
57 | enum e2; |
58 | |
59 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
60 | /** @return e3 Test 3 - expected warning here */ |
61 | enum e3; |
62 | enum e3* g3(void); |
63 | |
64 | /** @return e4 Test 4 */ |
65 | enum e4* g4(void); |
66 | enum e4 { one }; |
67 | |
68 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
69 | /** @return e5 Test 5 - expected warning here */ |
70 | enum e5 { two }; |
71 | enum e5* g5(void); |
72 | |
73 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
74 | /** @return e6 Test 6 - expected warning here */ |
75 | enum e6 *pe6; |
76 | enum e6* g6(void); |
77 | |
78 | // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}} |
79 | /** @return e7 Test 7 - expected warning here */ |
80 | enum e7; |
81 | enum e7* g7(void); |
82 | |
83 | enum e8 { three }; |
84 | /** @return e8 Test 8 */ |
85 | enum e4 *g8(enum e8 *p); |
86 | |