summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/synchronized.m
blob: 365da92dd4b177ee3b37efcec4ce2d0cf93d40d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// RUN: clang -fsyntax-only -verify %s
typedef signed char BOOL;
typedef unsigned int NSUInteger;
typedef struct _NSZone NSZone;
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;

@protocol NSObject
- (BOOL)isEqual:(id)object;
@end

@protocol NSCopying
- (id)copyWithZone:(NSZone *)zone;
@end

@protocol NSMutableCopying
- (id)mutableCopyWithZone:(NSZone *)zone;
@end

@protocol NSCoding
- (void)encodeWithCoder:(NSCoder *)aCoder;
@end

@interface NSObject <NSObject> {} @end

typedef float CGFloat;
typedef struct { int a; } NSFastEnumerationState;

@protocol NSFastEnumeration 
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
@end

typedef unsigned short unichar;

@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
- (NSUInteger)length;
@end

@interface NSSimpleCString : NSString {} @end

@interface NSConstantString : NSSimpleCString @end

extern void *_NSConstantStringClassReference;

@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
- (NSUInteger)count;
@end

@interface NSMutableDictionary : NSDictionary
- (void)removeObjectForKey:(id)aKey;
@end

@class NSArray, NSSet, NSHashTable;

@protocol PBXTrackableTask <NSObject>
- (float) taskPercentComplete;
- taskIdentifier;
@end

@interface PBXTrackableTaskManager : NSObject {
  NSMutableDictionary *_trackableTasks;
}
@end

NSString *XCExecutableDebugTaskIdentifier = @"XCExecutableDebugTaskIdentifier";

@implementation PBXTrackableTaskManager
- (id) init {}
- (void) unregisterTask:(id <PBXTrackableTask>) task {
  @synchronized (self) {
  id taskID = [task taskIdentifier];
  id task = [_trackableTasks objectForKey:taskID]; // expected-warning{{method '-objectForKey:' not found (return type defaults to 'id')}}
  }
}
@end

OpenPOWER on IntegriCloud