Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class -Wdocumentation -Wdocumentation-pedantic -verify %s |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 2 | |
| 3 | @class NSString; |
| 4 | |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 5 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 6 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 7 | @interface Test1 |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 8 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 9 | /** |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 10 | * \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 11 | * \param aaa Aaa |
| 12 | * \param bbb Bbb |
| 13 | */ |
| 14 | + (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb; |
| 15 | |
| 16 | // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} |
| 17 | /** |
| 18 | * \param aab Aaa |
| 19 | */ |
| 20 | + (NSString *)test2:(NSString *)aaa; |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 21 | |
| 22 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 23 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 24 | @property int test3; // a property: ObjCPropertyDecl |
| 25 | |
| 26 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 27 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 28 | @property int test4; // a property: ObjCPropertyDecl |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 29 | @end |
| 30 | |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 31 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 32 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 33 | @interface Test1() |
| 34 | @end |
| 35 | |
| 36 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 37 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 38 | @implementation Test1 // a class implementation : ObjCImplementationDecl |
| 39 | + (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb { |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | + (NSString *)test2:(NSString *)aaa { |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | @synthesize test3; // a property implementation: ObjCPropertyImplDecl |
| 48 | @dynamic test4; // a property implementation: ObjCPropertyImplDecl |
| 49 | |
| 50 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 51 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 52 | NSString *_test5; |
| 53 | @end |
| 54 | |
| 55 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 56 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 57 | @interface Test1(Test1Category) // a category: ObjCCategoryDecl |
| 58 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 59 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 60 | + (NSString *)test3:(NSString *)aaa; |
| 61 | @end |
| 62 | |
| 63 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 64 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 65 | @implementation Test1(Test1Category) // a category implementation: ObjCCategoryImplDecl |
| 66 | + (NSString *)test3:(NSString *)aaa { |
| 67 | return 0; |
| 68 | } |
| 69 | @end |
| 70 | |
| 71 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 72 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 73 | @protocol TestProto1 // a protocol: ObjCProtocolDecl |
| 74 | @end |
| 75 | |
| 76 | int a; |
| 77 | |
| 78 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 79 | /// \brief\author Aaa |
Dmitri Gribenko | abd56c8 | 2012-07-13 01:06:46 +0000 | [diff] [blame] | 80 | @interface Test4 |
| 81 | @end |
| 82 | |
| 83 | int b; |
| 84 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 85 | @interface TestReturns1 |
| 86 | /// \returns Aaa |
| 87 | - (int)test1:(NSString *)aaa; |
| 88 | |
| 89 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a method returning void}} |
| 90 | /// \returns Aaa |
| 91 | - (void)test2:(NSString *)aaa; |
| 92 | @end |
| 93 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 94 | // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 95 | /// \param aaa Meow. |
| 96 | /// \param bbb Bbb. |
| 97 | /// \returns aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 98 | typedef int (^test_param1)(int aaa, int ccc); |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 99 | |
Fariborz Jahanian | bca9788 | 2013-03-05 19:40:47 +0000 | [diff] [blame] | 100 | // rdar://13094352 |
Fariborz Jahanian | 88f070f | 2013-03-06 17:36:51 +0000 | [diff] [blame^] | 101 | // expected-warning@+2 {{'@method' command should be used in a comment attached to an objective-C method declaration}} |
Fariborz Jahanian | bca9788 | 2013-03-05 19:40:47 +0000 | [diff] [blame] | 102 | @interface I |
| 103 | /*! @method Base64EncodeEx |
| 104 | */ |
| 105 | typedef id ID; |
| 106 | - (unsigned) Base64EncodeEx : (ID)Arg; |
| 107 | @end |