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