gcc/testsuite/g++.dg/cpp0x/constexpr-delete2.C
raw| 1 | // PR c++/69203 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct A { ~A(); }; |
| 5 | constexpr int f(int i) { return i; } |
| 6 | constexpr int g(A* ap) |
| 7 | { |
| 8 | return f((delete[] ap, 42)); // { dg-message "" "" { target c++17_down } } |
| 9 | // { dg-error "" "" { target c++2a } .-1 } |
| 10 | } |
| 11 | |
| 12 | A a; |
| 13 | constexpr int i = g(&a); // { dg-error "" "" { target c++17_down } } |
| 14 | // { dg-message "in 'constexpr' expansion of" "" { target c++2a } .-1 } |