39 lines · plain
1// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both %s2// RUN: %clang_cc1 -verify=ref,both %s3 4@interface A {5 int a;6 static_assert(a, ""); // both-error {{static assertion expression is not an integral constant expression}}7}8@end9 10@interface NSString11@end12constexpr NSString *t0 = @"abc";13constexpr NSString *t1 = @("abc");14 15 16#if __LP64__17typedef unsigned long NSUInteger;18typedef long NSInteger;19#else20typedef unsigned int NSUInteger;21typedef int NSInteger;22#endif23 24 25@class NSNumber;26 27 28@interface NSObject29+ (NSObject*)nsobject;30@end31 32@interface NSNumber : NSObject33+ (NSNumber *)numberWithInt:(int)value;34@end35 36int main(void) {37 NSNumber *bv = @(1391126400 * 1000); // both-warning {{overflow in expression; result is -443'003'904 with type 'int'}}38}39