aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
blob: e3e13f755f958cccc6f21380e042c2e4c9c48404 (plain)
1
2
3
4
5
6
// Test that we catch excessive recursion.
// { dg-do compile { target c++11 } }
// { dg-options "-fconstexpr-depth=5" }
// { dg-prune-output "in constexpr expansion" }
constexpr int f (int i) { return f (i-1); }
constexpr int i = f(42);	// { dg-error "constexpr evaluation depth" }