1 // RUN: %clang_cc1 -verify %s
2 // REQUIRES: thread_support
4 // FIXME: Detection of, or recovery from, stack exhaustion does not work on
5 // NetBSD at the moment. Since this is a best-effort mitigation for exceeding
6 // implementation limits, just disable the test.
7 // UNSUPPORTED: system-netbsd
9 // expected-warning@* 0-1{{stack nearly exhausted}}
10 // expected-note@* 0+{{}}
12 template<int N
> struct X
: X
<N
-1> {};
13 template<> struct X
<0> {};
16 template<typename
...T
> struct tuple
{};
17 template<typename
...T
> auto f(tuple
<T
...> t
) -> decltype(f(tuple
<T
...>(t
))) {} // expected-error {{exceeded maximum depth}}
18 void g() { f(tuple
<int, int>()); }
21 template<int N
> auto f(X
<N
>) -> f(X
<N
-1>());