1 // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class -Wdocumentation -Wdocumentation-pedantic -verify %s
5 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
8 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
14 + (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb;
16 // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}}
20 + (NSString *)test2:(NSString *)aaa;
22 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
24 @property int test3; // a property: ObjCPropertyDecl
26 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
28 @property int test4; // a property: ObjCPropertyDecl
31 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
36 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
38 @implementation Test1 // a class implementation : ObjCImplementationDecl
39 + (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb {
43 + (NSString *)test2:(NSString *)aaa {
47 @synthesize test3; // a property implementation: ObjCPropertyImplDecl
48 @dynamic test4; // a property implementation: ObjCPropertyImplDecl
50 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
55 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
57 @interface Test1(Test1Category) // a category: ObjCCategoryDecl
58 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
60 + (NSString *)test3:(NSString *)aaa;
63 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
65 @implementation Test1(Test1Category) // a category implementation: ObjCCategoryImplDecl
66 + (NSString *)test3:(NSString *)aaa {
71 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
73 @protocol TestProto1 // a protocol: ObjCProtocolDecl
78 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
85 @interface TestReturns1
87 - (int)test1:(NSString *)aaa;
89 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a method returning void}}
91 - (void)test2:(NSString *)aaa;
94 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
98 typedef int (^test_param1)(int aaa, int ccc);
101 // expected-warning@+2 {{'@method' command should be used in a comment attached to an Objective-C method declaration}}
103 /*! @method Base64EncodeEx
106 - (unsigned) Base64EncodeEx : (ID)Arg;
110 // expected-warning@+5 {{'@interface' command should not be used in a comment attached to a non-interface declaration}}
111 // expected-warning@+5 {{'@classdesign' command should not be used in a comment attached to a non-container declaration}}
112 // expected-warning@+5 {{'@coclass' command should not be used in a comment attached to a non-container declaration}}
113 @interface NSObject @end
115 @interface IOCommandGate
116 @classdesign Multiple paragraphs go here.
121 @interface IOCommandGate : NSObject {
127 // expected-warning@+4 {{'@methodgroup' command should be used in a comment attached to an Objective-C method declaration}}
128 // expected-warning@+6 {{'@method' command should be used in a comment attached to an Objective-C method declaratio}}
129 @interface rdar12379114
131 @methodgroup Creating a request
134 @method initWithTimeout is the 2nd method
136 typedef unsigned int NSTimeInterval;
137 - (id)initWithTimeout:(NSTimeInterval)timeout;
140 // expected-warning@+2 {{'@protocol' command should not be used in a comment attached to a non-protocol declaration}}
147 @interface NSArray This is an array
150 @interface NSArray @end
153 @interface NSMutableArray
156 @interface NSMutableArray : NSArray @end
161 @protocol MyProto @end
163 // expected-warning@+2 {{'@protocol' command should not be used in a comment attached to a non-protocol declaration}}
167 @interface INTF <MyProto> @end
169 // expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}}
171 @struct S1 THIS IS IT