aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C
blob: 338251ce9546e4331a3d7815b78b237bb5477bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/67319
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts" }

template <typename T>
concept Any =
  requires (T t) { +t; };

struct my_struct
{
  template <Any... Args>
  auto sample(Args... args) -> void;
};

int main()
{
  my_struct{}.sample();
  my_struct{}.sample(0);
  my_struct{}.sample(0, 'a');
  my_struct{}.sample(nullptr); // { dg-error "" }
}