Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -verify -fsyntax-only %s |
Daniel Dunbar | 3568249 | 2008-09-26 04:12:28 +0000 | [diff] [blame] | 2 | |
| 3 | @class NSString; |
| 4 | |
| 5 | @interface A |
| 6 | -t1 __attribute__((noreturn)); |
| 7 | - (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); |
Daniel Dunbar | d3f2c10 | 2008-10-19 02:04:16 +0000 | [diff] [blame] | 8 | -(void) m0 __attribute__((noreturn)); |
| 9 | -(void) m1 __attribute__((unused)); |
Daniel Dunbar | 3568249 | 2008-09-26 04:12:28 +0000 | [diff] [blame] | 10 | @end |
Fariborz Jahanian | 5d36ac2 | 2009-05-12 21:36:23 +0000 | [diff] [blame] | 11 | |
| 12 | |
| 13 | @interface INTF |
| 14 | - (int) foo1: (int)arg1 __attribute__((deprecated)); |
| 15 | |
| 16 | - (int) foo: (int)arg1; |
| 17 | |
| 18 | - (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); |
| 19 | @end |
| 20 | |
| 21 | @implementation INTF |
Fariborz Jahanian | 09d04e5 | 2009-05-13 00:47:33 +0000 | [diff] [blame^] | 22 | - (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute can only be specified}} |
Fariborz Jahanian | 5d36ac2 | 2009-05-12 21:36:23 +0000 | [diff] [blame] | 23 | return 10; |
| 24 | } |
| 25 | - (int) foo1: (int)arg1 { |
| 26 | return 10; |
| 27 | } |
Fariborz Jahanian | 09d04e5 | 2009-05-13 00:47:33 +0000 | [diff] [blame^] | 28 | - (int) foo2: (int)arg1 __attribute__((deprecated)) { // expected-warning {{method attribute can only be specified}} |
Fariborz Jahanian | 5d36ac2 | 2009-05-12 21:36:23 +0000 | [diff] [blame] | 29 | return 10; |
| 30 | } |
| 31 | @end |
| 32 | |