diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Sema/warn-documentation.m | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Sema/warn-documentation.m')
-rw-r--r-- | test/Sema/warn-documentation.m | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/test/Sema/warn-documentation.m b/test/Sema/warn-documentation.m new file mode 100644 index 0000000..d6af6ed --- /dev/null +++ b/test/Sema/warn-documentation.m @@ -0,0 +1,93 @@ +// RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -Wdocumentation -Wdocumentation-pedantic -verify %s + +@class NSString; + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@interface Test1 +// expected-warning@+2 {{empty paragraph passed to '\brief' command}} +/** + * \brief\author Aaa + * \param aaa Aaa + * \param bbb Bbb + */ ++ (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb; + +// expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} +/** + * \param aab Aaa + */ ++ (NSString *)test2:(NSString *)aaa; + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@property int test3; // a property: ObjCPropertyDecl + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@property int test4; // a property: ObjCPropertyDecl +@end + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@interface Test1() +@end + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@implementation Test1 // a class implementation : ObjCImplementationDecl ++ (NSString *)test1:(NSString *)aaa suffix:(NSString *)bbb { + return 0; +} + ++ (NSString *)test2:(NSString *)aaa { + return 0; +} + +@synthesize test3; // a property implementation: ObjCPropertyImplDecl +@dynamic test4; // a property implementation: ObjCPropertyImplDecl + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +NSString *_test5; +@end + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@interface Test1(Test1Category) // a category: ObjCCategoryDecl +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa ++ (NSString *)test3:(NSString *)aaa; +@end + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@implementation Test1(Test1Category) // a category implementation: ObjCCategoryImplDecl ++ (NSString *)test3:(NSString *)aaa { + return 0; +} +@end + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@protocol TestProto1 // a protocol: ObjCProtocolDecl +@end + +int a; + +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +@interface Test4 +@end + +int b; + +@interface TestReturns1 +/// \returns Aaa +- (int)test1:(NSString *)aaa; + +// expected-warning@+1 {{'\returns' command used in a comment that is attached to a method returning void}} +/// \returns Aaa +- (void)test2:(NSString *)aaa; +@end + |