blob: 02fa86ec8d9eaf973f5e7d51ea475ac89d36c834 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Steve Naroff8970fea2008-10-22 22:40:28 +00002
3typedef signed char BOOL;
4typedef unsigned int NSUInteger;
5typedef struct _NSZone NSZone;
6@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
7@protocol NSObject - (BOOL)isEqual:(id)object; @end
Ted Kremenek3306ec12012-02-27 22:55:11 +00008@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method 'copyWithZone:' declared here}}
Steve Naroff8970fea2008-10-22 22:40:28 +00009@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end
10@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
11@interface NSObject <NSObject> {} @end
12typedef struct {} NSFastEnumerationState;
13@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end
14@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count; @end
Fariborz Jahanian14040142013-05-15 15:27:35 +000015@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is instance of class declared here}}
Steve Naroff8970fea2008-10-22 22:40:28 +000016extern NSString * const NSTaskDidTerminateNotification;
17
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000018@interface XCPropertyExpansionContext : NSObject <NSCopying> { // expected-note {{required for direct or indirect protocol 'NSCopying'}}
Steve Naroff8970fea2008-10-22 22:40:28 +000019 NSMutableDictionary * _propNamesToPropValuesCache;
20} @end
21
22@protocol XCPropertyValues <NSObject, NSCopying>
23- (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state;
24@end
25
Ted Kremenek8b43d2b2013-03-27 00:02:21 +000026@implementation XCPropertyExpansionContext // expected-warning {{method 'copyWithZone:' in protocol not implemented}}
Steve Naroff8970fea2008-10-22 22:40:28 +000027- (NSString *)expandedValueForProperty:(NSString *)property {
28 id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
Steve Naroffa8069f12008-11-17 19:49:16 +000029 if (cachedValueNode == ((void *)0)) { }
Steve Naroff8970fea2008-10-22 22:40:28 +000030 NSString * expandedValue = [cachedValueNode evaluateAsStringInContext:self withNestingState:((void *)0)];
31 return expandedValue;
32}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000033@end