================
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx11.0.0 
-fobjc-runtime=macosx-11.0.0 -fobjc-constant-literals 
-fconstant-nsnumber-literals -fconstant-nsarray-literals 
-fconstant-nsdictionary-literals -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple arm64-apple-ios15.1.0-simulator 
-fobjc-runtime=ios-15.1.0 -fobjc-arc -fobjc-constant-literals 
-fconstant-nsnumber-literals -fconstant-nsarray-literals 
-fconstant-nsdictionary-literals -verify %s
+
+#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 
|| NS_BUILD_32_LIKE_64
+typedef unsigned long NSUInteger;
+#else
+typedef unsigned int NSUInteger;
+#endif
+
+@class NSString;
+
+@interface NSNumber
++ (NSNumber *)numberWithInt:(int)value;
++ (NSNumber *)numberWithBool:(unsigned char)value;
+@end
+
+@interface NSArray
++ (id)arrayWithObjects:(const id[])objects count:(NSUInteger)cnt;
+@end
+
+@interface NSDictionary
++ (id)dictionaryWithObjects:(const id[])objects forKeys:(const id[])keys 
count:(NSUInteger)cnt;
+@end
+
+// ---- Accepted: NSString literal keys with constant literal values ---------
+
+static NSDictionary *const dASCII = @{@"a" : @1, @"m" : @2, @"z" : @3};
+static NSDictionary *const dEmpty = @{};
----------------
AaronBallman wrote:

Your changes mean we're also going to begin accepting:
```
const NSNumber *i = @2;
```
is that expected and okay?

https://github.com/llvm/llvm-project/pull/209688
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to