Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Wsemicolon-before-method-body %s -verify -fsyntax-only |
Steve Naroff | d9fd764 | 2009-04-07 14:18:33 +0000 | [diff] [blame] | 2 | |
| 3 | #define nil 0 /* id of Nil instance */ |
| 4 | |
| 5 | @interface NSObject |
| 6 | @end |
| 7 | |
| 8 | @interface NSString : NSObject |
| 9 | |
| 10 | @end |
| 11 | |
| 12 | @interface NSMutableString : NSString |
| 13 | |
| 14 | @end |
| 15 | |
| 16 | @interface NSSimpleCString : NSString { |
| 17 | @protected |
| 18 | char *bytes; |
| 19 | int numBytes; |
| 20 | } |
| 21 | @end |
| 22 | |
| 23 | @interface NSConstantString : NSSimpleCString |
| 24 | @end |
| 25 | |
| 26 | |
| 27 | @interface Subclass : NSObject |
| 28 | - (NSString *)token; |
| 29 | @end |
| 30 | |
| 31 | @implementation Subclass |
Fariborz Jahanian | 2b1f291 | 2009-10-20 17:24:11 +0000 | [diff] [blame] | 32 | - (NSString *)token; // expected-warning {{semicolon before method body is ignored}} |
Steve Naroff | d9fd764 | 2009-04-07 14:18:33 +0000 | [diff] [blame] | 33 | { |
| 34 | NSMutableString *result = nil; |
| 35 | |
| 36 | return (result != nil) ? result : @""; |
| 37 | } |
| 38 | @end |
| 39 | |