Debian Codegraph @

clang/test/SemaObjC/objc-string-constant.m

raw
1 // RUN: %clang_cc1 -Wsemicolon-before-method-body %s -verify -fsyntax-only
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
32 - (NSString *)token; // expected-warning {{semicolon before method body is ignored}}
33 {
34 NSMutableString *result = nil;
35
36 return (result != nil) ? result : @"";
37 }
38 @end
39