diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-07 23:33:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-07 23:33:11 +0000 |
commit | 28c1cd2138f700742235e1e720c1f7e6dc75a11a (patch) | |
tree | 90a877e791f9595b78b39cfcb668935ac1bb27cc /test/Sema | |
parent | 0689863f7b7fddf4a96e3036f3abe1d6f695ae51 (diff) |
HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/warn-documentation.cpp | 28 | ||||
-rw-r--r-- | test/Sema/warn-documentation.m | 52 |
2 files changed, 80 insertions, 0 deletions
diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index 32e43a77f9..0132ef280c 100644 --- a/test/Sema/warn-documentation.cpp +++ b/test/Sema/warn-documentation.cpp @@ -922,3 +922,31 @@ int test_nocrash12(); // expected-warning@+1 {{empty paragraph passed to '@param' command}} ///@param x@param y int test_nocrash13(int x, int y); + +// rdar://12379114 +// expected-warning@+2 {{'@union' command should not be used in a comment attached to a non-union declaration}} +/*! + @union U This is new +*/ +struct U { int iS; }; + +/*! + @union U1 +*/ +union U1 {int i; }; + +// expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}} +/*! + @struct S2 +*/ +union S2 {}; + +/*! + @class C1 +*/ +class C1; + +/*! + @struct S3; +*/ +class S3; diff --git a/test/Sema/warn-documentation.m b/test/Sema/warn-documentation.m index 5150955f63..98c4993561 100644 --- a/test/Sema/warn-documentation.m +++ b/test/Sema/warn-documentation.m @@ -105,3 +105,55 @@ typedef int (^test_param1)(int aaa, int ccc); typedef id ID; - (unsigned) Base64EncodeEx : (ID)Arg; @end + +// rdar://12379114 +// expected-warning@+5 {{'@interface' command should not be used in a comment attached to a non-interface declaration}} +// expected-warning@+5 {{'@classdesign' command should not be used in a comment attached to a non-container declaration}} +// expected-warning@+5 {{'@coclass' command should not be used in a comment attached to a non-container declaration}} +@interface NSObject @end +/*! +@interface IOCommandGate +@classdesign Multiple paragraphs go here. +@coclass myCoClass +*/ + +typedef id OBJ; +@interface IOCommandGate : NSObject { + OBJ iv; +} +@end + +// expected-warning@+2 {{'@protocol' command should not be used in a comment attached to a non-protocol declaration}} +/*! +@protocol PROTO +*/ +struct S; + +/*! + @interface NSArray This is an array +*/ +@class NSArray; +@interface NSArray @end + +/*! +@interface NSMutableArray +@super NSArray +*/ +@interface NSMutableArray : NSArray @end + +/*! + @protocol MyProto +*/ +@protocol MyProto @end + +// expected-warning@+2 {{'@protocol' command should not be used in a comment attached to a non-protocol declaration}} +/*! + @protocol MyProto +*/ +@interface INTF <MyProto> @end + +// expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}} +/*! + @struct S1 THIS IS IT +*/ +@interface S1 @end |