1 // RUN: %clang -fsyntax-only -std=c++2a -Xclang -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 %s
3 // RequiresExpr contains invalid requirement. (Eg. Highly recurisive template).
5 struct A
{ static constexpr bool far(); };
12 constexpr bool A
<0>::far() { return true; }
15 constexpr bool A
<x
>::far() {
16 return requires(B b
) {
18 requires A
<x
-1>::far(); // #Invalid
19 // expected-error@#Invalid {{recursive template instantiation exceeded maximum depth}}
20 // expected-note@#Invalid {{in instantiation}}
21 // expected-note@#Invalid 2 {{while}}
22 // expected-note@#Invalid {{contexts in backtrace}}
23 // expected-note@#Invalid {{increase recursive template instantiation depth}}
26 static_assert(A
<1>::far());
27 static_assert(!A
<6>::far()); // expected-note {{in instantiation of member function}}