1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
2 | |
3 | @interface PBXTrackableTaskManager @end |
4 | |
5 | @implementation PBXTrackableTaskManager |
6 | - (id) init { return 0; } |
7 | - (void) unregisterTask:(id) task { |
8 | @synchronized (self) { |
9 | id taskID = [task taskIdentifier]; // expected-warning {{method '-taskIdentifier' not found (return type defaults to 'id')}} |
10 | } |
11 | } |
12 | @end |
13 | |
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 | } |
24 | |