diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-08 03:21:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-08 03:21:47 +0000 |
commit | ce8eca578d6956885b46f1fb85173b1296f33dba (patch) | |
tree | b176ae78da1ddec35cbf2d599b414897adec09b0 /clang/test/Sema/integer-overflow.c | |
parent | 0ebc8605ad74082c1b01b8500782ca220d3eb0df (diff) | |
download | llvm-ce8eca578d6956885b46f1fb85173b1296f33dba.zip llvm-ce8eca578d6956885b46f1fb85173b1296f33dba.tar.gz llvm-ce8eca578d6956885b46f1fb85173b1296f33dba.tar.bz2 |
Explicitly permit undefined behavior in constant initializers for global
variables in C, in the cases where we can constant-fold it to a value
regardless (such as floating-point division by zero and signed integer
overflow). Strictly enforcing this rule breaks too much code.
llvm-svn: 254992
Diffstat (limited to 'clang/test/Sema/integer-overflow.c')
-rw-r--r-- | clang/test/Sema/integer-overflow.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c index 8f74873..44fbcd4 100644 --- a/clang/test/Sema/integer-overflow.c +++ b/clang/test/Sema/integer-overflow.c @@ -7,7 +7,6 @@ uint64_t f1(uint64_t, uint32_t); uint64_t f2(uint64_t, ...); static const uint64_t overflow = 1 * 4608 * 1024 * 1024; // expected-warning {{overflow in expression; result is 536870912 with type 'int'}} -// expected-error@-1 {{not a compile-time constant}} uint64_t check_integer_overflows(int i) { // expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} |