Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C

raw
1 // PR c++/67319
2 // { dg-do compile { target c++20 } }
3 // { dg-additional-options "-fconcepts" }
4
5 template <typename T>
6 concept Any =
7 requires (T t) { +t; };
8
9 struct my_struct
10 {
11 template <Any... Args>
12 auto sample(Args... args) -> void;
13 };
14
15 int main()
16 {
17 my_struct{}.sample();
18 my_struct{}.sample(0);
19 my_struct{}.sample(0, 'a');
20 my_struct{}.sample(nullptr); // { dg-error "" }
21 }
22