aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C
blob: 0103e7a591f8c582c33e0d110a22d61bb9abac52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do compile { target c++20 } }

template<int N, typename T>
concept Foo = requires(T t) { foo<N + 1>(t); }; // { dg-error "template instantiation depth" }

namespace ns
{
  struct S { };

  template<int N, typename T>
    requires Foo<N, T>
  int foo(T t)
  {
    return foo<N + 1>(t);
  }
}

int main(int, char**)
{
  return foo<1>(ns::S{});
}

// { dg-prune-output "compilation terminated" }