diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/SemaObjC/method-attributes.m | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/SemaObjC/method-attributes.m')
-rw-r--r-- | test/SemaObjC/method-attributes.m | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/SemaObjC/method-attributes.m b/test/SemaObjC/method-attributes.m new file mode 100644 index 0000000..c4d4fba --- /dev/null +++ b/test/SemaObjC/method-attributes.m @@ -0,0 +1,32 @@ +// RUN: clang-cc -verify -fsyntax-only %s + +@class NSString; + +@interface A +-t1 __attribute__((noreturn)); +- (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); +-(void) m0 __attribute__((noreturn)); +-(void) m1 __attribute__((unused)); +@end + + +@interface INTF +- (int) foo1: (int)arg1 __attribute__((deprecated)); + +- (int) foo: (int)arg1; + +- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); +@end + +@implementation INTF +- (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute can only be specified}} + return 10; +} +- (int) foo1: (int)arg1 { + return 10; +} +- (int) foo2: (int)arg1 __attribute__((deprecated)) { // expected-warning {{method attribute can only be specified}} + return 10; +} +@end + |