Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
rev | line source |
---|---|
145 | 1 // PR c++/66832 |
2 // { dg-do compile { target c++2a } } | |
3 | |
4 template <class T, class U, unsigned N> | |
5 requires requires (T& t, U &u) { t.foo(); u.foo(); } | |
6 void foo_all( T (&t)[N], U (&u)[N] ) { | |
7 for(auto& x : t) | |
8 x.foo(); | |
9 for(auto& x : u) | |
10 x.foo(); | |
11 } | |
12 | |
13 struct S { | |
14 void foo() {} | |
15 }; | |
16 | |
17 int main() { | |
18 S rg[4] {}; | |
19 foo_all(rg, rg); | |
20 } | |
21 |