forked from OSchip/llvm-project
Add more tests for NSArray/NSDictionary literals
llvm-svn: 229470
This commit is contained in:
parent
480e2b6e43
commit
10c4546498
|
@ -9,6 +9,18 @@ typedef unsigned long NSUInteger;
|
|||
typedef unsigned int NSUInteger;
|
||||
#endif
|
||||
|
||||
void checkNSArrayUnavailableDiagnostic() {
|
||||
id obj;
|
||||
id arr = @[obj]; // expected-error {{NSArray must be available to use Objective-C array literals}}
|
||||
}
|
||||
|
||||
@class NSArray;
|
||||
|
||||
void checkNSArrayFDDiagnostic() {
|
||||
id obj;
|
||||
id arr = @[obj]; // expected-error {{declaration of 'arrayWithObjects:count:' is missing in NSArray class}}
|
||||
}
|
||||
|
||||
@class NSString;
|
||||
|
||||
extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
|
||||
|
|
|
@ -5,6 +5,20 @@
|
|||
|
||||
#define nil ((void *)0)
|
||||
|
||||
void checkNSDictionaryUnavailableDiagnostic() {
|
||||
id key;
|
||||
id value;
|
||||
id dict = @{ key : value }; // expected-error {{NSDictionary must be available to use Objective-C dictionary literals}}
|
||||
}
|
||||
|
||||
@class NSDictionary;
|
||||
|
||||
void checkNSDictionaryFDDiagnostic() {
|
||||
id key;
|
||||
id value;
|
||||
id dic = @{ key : value }; // expected-error {{declaration of 'dictionaryWithObjects:forKeys:count:' is missing in NSDictionary class}}
|
||||
}
|
||||
|
||||
@interface NSNumber
|
||||
+ (NSNumber *)numberWithChar:(char)value;
|
||||
+ (NSNumber *)numberWithInt:(int)value;
|
||||
|
|
Loading…
Reference in New Issue