gcc/testsuite/g++.dg/ext/fimplicit-constexpr1.C
raw| 1 | // { dg-additional-options -fimplicit-constexpr } |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | void f() { } // { dg-message "'-fimplicit-constexpr' only affects 'inline' functions" } |
| 5 | |
| 6 | inline int g() { f(); return 42; } // { dg-error {non-'constexpr' function 'void f\(\)'} } |
| 7 | |
| 8 | constexpr int i = g(); // { dg-error {'int g\(\)' called in a constant expression} } |