blob: c158815acbf878b975b25dc7f71515cb65d62c55 [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Steve Naroff3ac438c2008-06-04 20:36:13 +00002
Fariborz Jahanian77a6be42009-04-23 21:49:04 +00003@interface PBXTrackableTaskManager @end
Steve Naroff3ac438c2008-06-04 20:36:13 +00004
5@implementation PBXTrackableTaskManager
Mike Stumpd1969d82009-07-22 00:43:08 +00006- (id) init { return 0; }
Chris Lattnera868a202009-04-21 06:11:25 +00007- (void) unregisterTask:(id) task {
Steve Naroff3ac438c2008-06-04 20:36:13 +00008 @synchronized (self) {
Chris Lattnera868a202009-04-21 06:11:25 +00009 id taskID = [task taskIdentifier]; // expected-warning {{method '-taskIdentifier' not found (return type defaults to 'id')}}
Steve Naroff3ac438c2008-06-04 20:36:13 +000010 }
11}
12@end
13
Chris Lattnera868a202009-04-21 06:11:25 +000014
15struct x { int a; } b;
16
17void 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}