brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 7da7749 Raw
34 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 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; @end8@protocol NSCopying  - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method 'copyWithZone:' declared here}}9@protocol NSMutableCopying  - (id)mutableCopyWithZone:(NSZone *)zone; @end10@protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder; @end11@interface NSObject <NSObject> {} @end12typedef struct {} NSFastEnumerationState;13@protocol NSFastEnumeration  - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end14@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>  - (NSUInteger)count; @end15@interface NSMutableDictionary : NSDictionary  - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is instance of class declared here}}16extern NSString * const NSTaskDidTerminateNotification;17 18@interface XCPropertyExpansionContext : NSObject <NSCopying> {19  NSMutableDictionary * _propNamesToPropValuesCache;20} @end21 22@protocol XCPropertyValues <NSObject, NSCopying>23- (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state;24@end25 26@implementation XCPropertyExpansionContext // expected-warning {{method 'copyWithZone:' in protocol 'NSCopying' not implemented}}27- (NSString *)expandedValueForProperty:(NSString *)property {28  id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}29  if (cachedValueNode == ((void *)0)) { }30  NSString * expandedValue = [cachedValueNode evaluateAsStringInContext:self withNestingState:((void *)0)];31  return expandedValue;32}33@end34