]>
Commit | Line | Data |
---|---|---|
7b936140 | 1 | // { dg-options "-std=c++17 -fconcepts" } |
971e17ff AS |
2 | |
3 | // Check equivalence of short- and longhand declarations. | |
4 | ||
5 | template<typename T> | |
6 | concept bool C() { return __is_class(T); } | |
7 | ||
8 | template<typename T> | |
9 | concept bool D() { return __is_empty(T); } | |
10 | ||
11 | struct X { } x; | |
12 | ||
13 | void f1(C x); | |
14 | template<C T> void f2(T x); | |
15 | void f3(C x); | |
16 | template<C T> void f4(T x) requires D<T>(); | |
17 | template<C T> void f5(T x) requires D<T>(); | |
18 | template<C T> void f6(T x) requires D<T>(); | |
19 | ||
20 | int main() { | |
21 | f1(x); | |
22 | f2(x); | |
23 | f3(x); | |
24 | f4(x); | |
25 | f5(x); | |
26 | f6(x); | |
27 | } | |
28 | ||
29 | template<typename T> requires C<T>() void f1(T x) { } | |
30 | template<typename T> requires C<T>() void f2(T x) { } | |
31 | template<C T> void f3(T x) { } | |
32 | template<typename T> requires C<T>() void f4(T x) requires D<T>() { } | |
33 | template<typename T> requires C<T>() and D<T>() void f5(T x) { } | |
34 | template<typename T> void f6(T x) requires C<T>() and D<T>() { } |