Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | 3ac438c | 2008-06-04 20:36:13 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 77a6be4 | 2009-04-23 21:49:04 +0000 | [diff] [blame] | 3 | @interface PBXTrackableTaskManager @end |
Steve Naroff | 3ac438c | 2008-06-04 20:36:13 +0000 | [diff] [blame] | 4 | |
| 5 | @implementation PBXTrackableTaskManager |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 6 | - (id) init { return 0; } |
Chris Lattner | a868a20 | 2009-04-21 06:11:25 +0000 | [diff] [blame] | 7 | - (void) unregisterTask:(id) task { |
Steve Naroff | 3ac438c | 2008-06-04 20:36:13 +0000 | [diff] [blame] | 8 | @synchronized (self) { |
Chris Lattner | a868a20 | 2009-04-21 06:11:25 +0000 | [diff] [blame] | 9 | id taskID = [task taskIdentifier]; // expected-warning {{method '-taskIdentifier' not found (return type defaults to 'id')}} |
Steve Naroff | 3ac438c | 2008-06-04 20:36:13 +0000 | [diff] [blame] | 10 | } |
| 11 | } |
| 12 | @end |
| 13 | |
Chris Lattner | a868a20 | 2009-04-21 06:11:25 +0000 | [diff] [blame] | 14 | |
| 15 | struct x { int a; } b; |
| 16 | |
| 17 | void test1() { |
| 18 | @synchronized (b) { // expected-error {{@synchronized requires an Objective-C object type ('struct x' invalid)}} |
| 19 | } |
| 20 | |
| 21 | @synchronized (42) { // expected-error {{@synchronized requires an Objective-C object type ('int' invalid)}} |
| 22 | } |
| 23 | } |