40 lines · plain
1// RUN: %clang_cc1 -Wsemicolon-before-method-body %s -verify -fsyntax-only2 3#define nil 0 /* id of Nil instance */4 5@interface NSObject 6@end7 8@interface NSString : NSObject9 10@end11 12@interface NSMutableString : NSString13 14@end15 16@interface NSSimpleCString : NSString {17@protected18 char *bytes;19 int numBytes;20}21@end22 23@interface NSConstantString : NSSimpleCString24@end25 26 27@interface Subclass : NSObject 28- (NSString *)token;29@end30 31@implementation Subclass32- (NSString *)token; // expected-warning {{semicolon before method body is ignored}}33{34 NSMutableString *result = nil;35 36 return (result != nil) ? result : @"";37}38@end39 40