blob: a3680e475ee2ec288d830f033ef4d03b084faac6 [file] [log] [blame]
Douglas Gregor0fbda682010-09-15 14:51:05 +00001// Objective-C recovery
2// RUN: cp %s %t
Richard Smith23153182011-09-06 03:01:15 +00003// RUN: not %clang_cc1 -pedantic -Wall -fixit -x objective-c %t
Douglas Gregor0fbda682010-09-15 14:51:05 +00004// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x objective-c %t
5
6// Objective-C++ recovery
7// RUN: cp %s %t
Richard Smith23153182011-09-06 03:01:15 +00008// RUN: not %clang_cc1 -pedantic -Wall -fixit -x objective-c++ %t
Douglas Gregor0fbda682010-09-15 14:51:05 +00009// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x objective-c++ %t
10
11@interface A
12- (int)method1:(int)x second:(float)y;
13+ (int)method2:(int)x second:(double)y;
Douglas Gregorb65042d2010-09-15 14:54:45 +000014- (int)getBlah;
Douglas Gregor0fbda682010-09-15 14:51:05 +000015@end
16
17void f(A *a, int i, int j) {
18 a method1:5+2 second:+(3.14159)];
19 a method1:[a method1:3 second:j] second:i++]
Douglas Gregorb65042d2010-09-15 14:54:45 +000020 a getBlah];
Douglas Gregorfa885c12010-09-15 15:09:43 +000021
22 int array[17];
23 (void)array[a method1:5+2 second:+(3.14159)]];
Douglas Gregor9497a732010-09-16 01:51:54 +000024 (A method2:5+2 second:3.14159]);
25 A method2:5+2 second:3.14159]
26 if (A method2:5+2 second:3.14159]) { }
Douglas Gregor0fbda682010-09-15 14:51:05 +000027}
Douglas Gregorfa885c12010-09-15 15:09:43 +000028
29@interface B : A
30- (int)method1:(int)x second:(float)y;
31@end
32
33@implementation B
34- (int)method1:(int)x second:(float)y {
35 super method1:x second:y];
36 return super getBlah];
37}
38@end