summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-10-28 18:28:16 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-10-28 18:28:16 +0000
commit9ad94aa280619feaed083fd35f9a50c7e076a7b0 (patch)
treed395d7e34bf528c7cc3c44da0d5e75d52cde3485 /clang/test/SemaObjC
parentd178ada55ea4cc5d71443ec27495092fbb72b230 (diff)
downloadbcm5719-llvm-9ad94aa280619feaed083fd35f9a50c7e076a7b0.tar.gz
bcm5719-llvm-9ad94aa280619feaed083fd35f9a50c7e076a7b0.zip
Objective-C. revert patch for rdar://17554063.
llvm-svn: 220812
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/arc.m18
-rw-r--r--clang/test/SemaObjC/objc-literal-comparison.m5
2 files changed, 6 insertions, 17 deletions
diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m
index 2816cef7553..54a7db7b11b 100644
--- a/clang/test/SemaObjC/arc.m
+++ b/clang/test/SemaObjC/arc.m
@@ -5,14 +5,9 @@ typedef const void * CFTypeRef;
CFTypeRef CFBridgingRetain(id X);
id CFBridgingRelease(CFTypeRef);
@protocol NSCopying @end
-@interface NSObject
-+ (id)alloc;
-@end
-
-@interface NSDictionary : NSObject
+@interface NSDictionary
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
- (void)setObject:(id)object forKeyedSubscript:(id)key;
-- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
@end
@class NSFastEnumerationState;
@protocol NSFastEnumeration
@@ -21,9 +16,8 @@ id CFBridgingRelease(CFTypeRef);
@interface NSNumber
+ (NSNumber *)numberWithInt:(int)value;
@end
-@interface NSArray : NSObject <NSFastEnumeration>
+@interface NSArray <NSFastEnumeration>
+ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
-- (id)initWithObjects:(const id [])objects count:(NSUInteger)cnt;
@end
void test0(void (*fn)(int), int val) {
@@ -748,16 +742,16 @@ void _NSCalcBeze(NSColor* color, NSColor* bezelColors[]); // expected-error {{mu
void rdar12569201(id key, id value) {
// Declarations.
__weak id x = @"foo"; // no-warning
- __weak id y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
- __weak id z = @[ value ]; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
+ __weak id y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}
+ __weak id z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}
__weak id b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}
__weak id n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
__weak id e = @(42); // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
__weak id m = @(41 + 1); // expected-warning {{assigning boxed expression to a weak variable; object will be released after assignment}}
// Assignments.
- y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
- z = @[ value ]; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
+ y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}
+ z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}
b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}
n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
e = @(42); // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
diff --git a/clang/test/SemaObjC/objc-literal-comparison.m b/clang/test/SemaObjC/objc-literal-comparison.m
index 409d7134ef3..95ebfb397b0 100644
--- a/clang/test/SemaObjC/objc-literal-comparison.m
+++ b/clang/test/SemaObjC/objc-literal-comparison.m
@@ -10,15 +10,12 @@
typedef signed char BOOL;
-@protocol NSCopying @end
-
@interface BaseObject
+ (instancetype)new;
@end
@interface NSObject : BaseObject
- (BOOL)isEqual:(id)other;
-+ (id)alloc;
@end
@interface NSNumber : NSObject
@@ -29,12 +26,10 @@ typedef signed char BOOL;
@interface NSArray : NSObject
+ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
-- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
@end
@interface NSDictionary : NSObject
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
-- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(unsigned long)cnt;
@end
@interface NSString : NSObject
OpenPOWER on IntegriCloud