Douglas Gregor | 0fbda68 | 2010-09-15 14:51:05 +0000 | [diff] [blame] | 1 | // Objective-C recovery |
| 2 | // RUN: cp %s %t |
| 3 | // RUN: %clang_cc1 -pedantic -Wall -fixit -x objective-c %t || true |
| 4 | // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x objective-c %t |
| 5 | |
| 6 | // Objective-C++ recovery |
| 7 | // RUN: cp %s %t |
| 8 | // RUN: %clang_cc1 -pedantic -Wall -fixit -x objective-c++ %t || true |
| 9 | // 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 Gregor | b65042d | 2010-09-15 14:54:45 +0000 | [diff] [blame] | 14 | - (int)getBlah; |
Douglas Gregor | 0fbda68 | 2010-09-15 14:51:05 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | void 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 Gregor | b65042d | 2010-09-15 14:54:45 +0000 | [diff] [blame] | 20 | a getBlah]; |
Douglas Gregor | fa885c1 | 2010-09-15 15:09:43 +0000 | [diff] [blame] | 21 | |
| 22 | int array[17]; |
| 23 | (void)array[a method1:5+2 second:+(3.14159)]]; |
Douglas Gregor | 9497a73 | 2010-09-16 01:51:54 +0000 | [diff] [blame] | 24 | (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 Gregor | 0fbda68 | 2010-09-15 14:51:05 +0000 | [diff] [blame] | 27 | } |
Douglas Gregor | fa885c1 | 2010-09-15 15:09:43 +0000 | [diff] [blame] | 28 | |
| 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 |