[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / no-documentation-warn-tagdecl-specifier.c
blobe85474bffff594ab9ea836b4f987c8730962acf9
1 // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -verify %s
3 /** @return s Test*/
4 struct s* f(void);
5 struct s;
7 struct s1;
8 /** @return s1 Test 1*/
9 struct s1* f1(void);
11 struct s2;
12 /** @return s2 Test 2*/
13 struct s2* f2(void);
14 struct s2;
16 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
17 /** @return s3 Test 3 - expected warning here */
18 struct s3;
19 struct s3* f3(void);
21 /** @return s4 Test 4 */
22 struct s4* f4(void);
23 struct s4 { int is; };
25 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
26 /** @return s5 Test 5 - expected warning here */
27 struct s5 { int is; };
28 struct s5* f5(void);
30 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
31 /** @return s6 Test 6 - expected warning here */
32 struct s6 *ps6;
33 struct s6* f6(void);
35 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
36 /** @return s7 Test 7 - expected warning here */
37 struct s7;
38 struct s7* f7(void);
40 struct s8 { int is8; };
41 /** @return s8 Test 8 */
42 struct s4 *f8(struct s8 *p);
45 /** @return e Test*/
46 enum e* g(void);
47 enum e;
49 enum e1;
50 /** @return e1 Test 1*/
51 enum e1* g1(void);
53 enum e2;
54 /** @return e2 Test 2*/
55 enum e2* g2(void);
56 enum e2;
58 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
59 /** @return e3 Test 3 - expected warning here */
60 enum e3;
61 enum e3* g3(void);
63 /** @return e4 Test 4 */
64 enum e4* g4(void);
65 enum e4 { one };
67 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
68 /** @return e5 Test 5 - expected warning here */
69 enum e5 { two };
70 enum e5* g5(void);
72 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
73 /** @return e6 Test 6 - expected warning here */
74 enum e6 *pe6;
75 enum e6* g6(void);
77 // expected-warning@+1 {{'@return' command used in a comment that is not attached to a function or method declaration}}
78 /** @return e7 Test 7 - expected warning here */
79 enum e7;
80 enum e7* g7(void);
82 enum e8 { three };
83 /** @return e8 Test 8 */
84 enum e4 *g8(enum e8 *p);