annotate gcc/testsuite/g++.dg/cpp2a/concepts-pr78752-2.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 // { dg-do compile { target c++2a } }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2 // { dg-additional-options "-fconcepts-ts" }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 template <class T, class U>
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 concept bool Same = __is_same(T, U);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 struct test {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 void func(Same<int>... ints) {}
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 void func(Same<int>... ints) {}
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 int main()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 test t;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 t.func(1, 2, 3);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17 func(1, 2, 3);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 t.func(1, 2, ""); // { dg-error "no match" }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 func(1, 2, ""); // { dg-error "unsatisfied constraints" }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 }