Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // PR c++/67427 | |
2 // { dg-do compile { target c++2a } } | |
3 // { dg-additional-options "-fconcepts-ts" } | |
4 | |
5 template <bool... Values> struct and_c_impl { | |
6 static constexpr bool value = true; | |
7 }; | |
8 | |
9 template <bool ValueFirst, bool... ValuesRest> | |
10 struct and_c_impl<ValueFirst, ValuesRest...> { | |
11 static constexpr bool value = ValueFirst && and_c_impl<ValuesRest...>::value; | |
12 }; | |
13 | |
14 template <bool... Values> constexpr bool and_c() { | |
15 return and_c_impl<Values...>::value; | |
16 } | |
17 | |
18 template<class T> concept bool C() { | |
19 return true; | |
20 } | |
21 | |
22 template<class... Tx> | |
23 struct A { | |
24 A() requires and_c<C<Tx>()...>() = default; | |
25 }; | |
26 | |
27 int main() { | |
28 A<int, double> a; | |
29 return 0; | |
30 } |