19 lines · cpp
1// RUN: %clang_cc1 %s -Wno-unused-value -verify -fsyntax-only2 3namespace GH58944 {4struct A {5 A(unsigned long) ;6};7 8A a(1024 * 1024 * 1024 * 1024 * 1024ull); // expected-warning {{overflow in expression; result is 0 with type 'int'}}9 10void f() {11 new int[1024 * 1024 * 1024 * 1024 * 1024ull]; // expected-warning {{overflow in expression; result is 0 with type 'int'}}12 13 int arr[]{1,2,3};14 arr[1024 * 1024 * 1024 * 1024 * 1024ull]; // expected-warning {{overflow in expression; result is 0 with type 'int'}}15 16 (int){1024 * 1024 * 1024 * 1024 * 1024}; // expected-warning {{overflow in expression; result is 0 with type 'int'}}17}18}19