From ad8886896e5316ff913b8c684df1cfc2910f5973 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 27 Apr 2017 07:27:36 +0000 Subject: In the expression evaluator, visit the index of an ArraySubscriptExpr even if we can't evaluate the base, if the evaluation mode tells us to continue evaluation. llvm-svn: 301522 --- clang/test/Sema/integer-overflow.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/test/Sema/integer-overflow.c') diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c index 12d2c4f29e0..44c2629ebf7 100644 --- a/clang/test/Sema/integer-overflow.c +++ b/clang/test/Sema/integer-overflow.c @@ -147,6 +147,10 @@ uint64_t check_integer_overflows(int i) { uint64_t a[10]; a[4608 * 1024 * 1024] = 1i; +// expected-warning@+2 {{overflow in expression; result is 536870912 with type 'int'}} + uint64_t *b; + uint64_t b2 = b[4608 * 1024 * 1024] + 1; + // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} (void)((i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)) + 1); -- cgit v1.2.3