gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept4.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // We used to treat a call to a constexpr function as noexcept if |
| 3 | // the call was a constant expression. We no longer do since |
| 4 | // c++/87603. |
| 5 | |
| 6 | #define SA(X) static_assert(X,#X) |
| 7 | |
| 8 | constexpr const int* f(const int *p) { return p; } |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | constexpr int i = 42; |
| 13 | SA(!noexcept(*f(&i))); |
| 14 | SA(!noexcept(f(&i))); |
| 15 | } |