gcc/testsuite/g++.dg/cpp0x/constexpr-noreturn1.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-additional-options -Winvalid-constexpr } |
| 3 | |
| 4 | // We were giving a wrong error about loading a volatile value instead of the |
| 5 | // proper error about calling a non-constexpr function. |
| 6 | |
| 7 | [[noreturn]] void f(); |
| 8 | |
| 9 | constexpr int g() |
| 10 | { |
| 11 | return f(), 42; // { dg-message "call to non-'constexpr' function" } |
| 12 | } |