aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C
blob: 95e9c32f8f1ceea68b3c6c92a83f0fe6c1f405f5 (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
39
40
41
42
43
44
45
46
47
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts" }

template<typename F>
concept FCallable =
  requires(F)
  {
      F::f();
  };


class Test1
{
public:
  template<FCallable P, FCallable... Pp>
  static void g()
  {
    (Pp::f(), ...);
  }
};

class A
{
public:
  static void f() {}
};

template<typename X> concept C = true;

template<C... X>
void bar(X...)
{}

struct foo
{
  template<C... X>
  void bar(X...)
  {}
};

int main()
{
  Test1::template g<A>();
  bar();
  foo {}.bar();
}