freebsd-dev/test/SemaObjC/synchronized.m

24 lines
632 B
Mathematica
Raw Normal View History

2009-12-15 18:49:47 +00:00
// RUN: clang -cc1 -fsyntax-only -verify %s
2009-06-02 17:58:47 +00:00
@interface PBXTrackableTaskManager @end
@implementation PBXTrackableTaskManager
2009-10-14 18:03:49 +00:00
- (id) init { return 0; }
2009-06-02 17:58:47 +00:00
- (void) unregisterTask:(id) task {
@synchronized (self) {
id taskID = [task taskIdentifier]; // expected-warning {{method '-taskIdentifier' not found (return type defaults to 'id')}}
}
}
@end
struct x { int a; } b;
void test1() {
@synchronized (b) { // expected-error {{@synchronized requires an Objective-C object type ('struct x' invalid)}}
}
@synchronized (42) { // expected-error {{@synchronized requires an Objective-C object type ('int' invalid)}}
}
}