summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
blob: 2f9b4887df6dde933ec320e828a9f48fb5a77487 (plain)
1
2
3
4
5
// Test that we catch excessive recursion.
// { dg-options "-std=c++0x -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" }