diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2017-05-01 02:03:23 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2017-05-01 02:03:23 +0000 |
commit | 499968f8a57cfe8bd44ac7370949809d77172391 (patch) | |
tree | 30315885802e1d5e3503cea22fb86ffb3fbc3a20 /clang/test/Sema/integer-overflow.c | |
parent | fea2d0b8bf28a12ad54b8061fa72f996abcbe12a (diff) | |
download | bcm5719-llvm-499968f8a57cfe8bd44ac7370949809d77172391.tar.gz bcm5719-llvm-499968f8a57cfe8bd44ac7370949809d77172391.zip |
Handle expressions with non-literal types like ignored expressions if we are supposed to continue evaluating them.
Also fix a crash casting a derived nullptr to a virtual base.
llvm-svn: 301785
Diffstat (limited to 'clang/test/Sema/integer-overflow.c')
-rw-r--r-- | clang/test/Sema/integer-overflow.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c index 62ee33e3d18..2f5747dd0bf 100644 --- a/clang/test/Sema/integer-overflow.c +++ b/clang/test/Sema/integer-overflow.c @@ -149,16 +149,16 @@ uint64_t check_integer_overflows(int i) { // expected-warning@+2 {{overflow in expression; result is 536870912 with type 'int'}} uint64_t *b; - uint64_t b2 = b[4608 * 1024 * 1024] + 1; + (void)b[4608 * 1024 * 1024] + 1; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} - int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024); + (void)(i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)); // expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} - int j2 = -(4608 * 1024 * 1024); + (void)(-(4608 * 1024 * 1024)); // expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} - uint64_t j3 = b[4608 * 1024 * 1024]; + (void)b[4608 * 1024 * 1024]; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024))); |