xref: /llvm-project/clang/test/Rewriter/rewrite-modern-array-literal.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3
4extern "C" void *sel_registerName(const char *);
5@class NSString;
6
7@interface NSNumber
8+ (NSNumber *)numberWithChar:(char)value;
9+ (NSNumber *)numberWithInt:(int)value;
10@end
11
12typedef unsigned long NSUInteger;
13
14@interface NSArray
15+ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
16@end
17
18int i;
19int main() {
20  NSArray *array = @[ @"Hello", @1234 ];
21  if (i) {
22    NSArray *array = @[ @"Hello", @1234 ];
23  }
24  NSArray *array1 = @[ @"Hello", @1234, @[ @"Hello", @1234 ] ];
25}
26
27