summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/intro1.C
blob: 5f036c4b6454b0f3a8f32c3ae41f1050684098b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// { dg-options "-std=c++1z -fconcepts" }

template<typename T>
  concept bool C = __is_class(T);

C{T} void f1();

struct S1
{
  C{T} void f2();
  C{T} static void f3();
};

int main()
{
  S1 s;

  f1<S1>();
  s.f2<S1>();
  S1::f3<S1>();

  return 0;
}

template<typename T>
  void f1() requires C<T>
  {
  }

template<typename T>
  void S1::f2() requires C<T>
  {
  }

template<typename T>
  void S1::f3() requires C<T>
  {
  }