brintos

brintos / llvm-project-archived public Read only

0
0
Text · 657 B · 21ffc32 Raw
24 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface PBXTrackableTaskManager @end4 5@implementation PBXTrackableTaskManager6- (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@end13 14 15struct x { int a; } b;16 17void test1(void) {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