gcc/testsuite/g++.dg/cpp0x/constexpr-overflow.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-options "-w -ftrack-macro-expansion=0" } |
| 3 | |
| 4 | #include <limits.h> |
| 5 | extern constexpr int max_s = INT_MAX + 1; // { dg-error "" } |
| 6 | extern constexpr unsigned max_u = UINT_MAX + 1u; // OK |
| 7 | extern constexpr int abs_s = -INT_MIN; // { dg-error "" } overflows on 2's complement machines |