| 1 |
// DR 2855, Undefined behavior in postfix increment |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
using int8_t = signed char; |
| 5 |
|
| 6 |
constexpr int |
| 7 |
f () |
| 8 |
{ |
| 9 |
int8_t x = 127; |
| 10 |
x++; |
| 11 |
int8_t z = 127; |
| 12 |
++z; |
| 13 |
return x + z; |
| 14 |
} |
| 15 |
|
| 16 |
constexpr int i = f(); |