blob: cc6d60c82ae6c2eb1268ff10348382fb35a9f633 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -Wsemicolon-before-method-body %s -verify -fsyntax-only
Steve Naroffd9fd7642009-04-07 14:18:33 +00002
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 Jahanian2b1f2912009-10-20 17:24:11 +000032- (NSString *)token; // expected-warning {{semicolon before method body is ignored}}
Steve Naroffd9fd7642009-04-07 14:18:33 +000033{
34 NSMutableString *result = nil;
35
36 return (result != nil) ? result : @"";
37}
38@end
39