]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/concepts/equiv.C
invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z...
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / concepts / equiv.C
CommitLineData
7b936140 1// { dg-options "-std=c++17 -fconcepts" }
971e17ff
AS
2
3// Check equivalence of short- and longhand declarations.
4
5template<typename T>
6 concept bool C() { return __is_class(T); }
7
8template<typename T>
9 concept bool D() { return __is_empty(T); }
10
11struct X { } x;
12
13void f1(C x);
14template<C T> void f2(T x);
15void f3(C x);
16template<C T> void f4(T x) requires D<T>();
17template<C T> void f5(T x) requires D<T>();
18template<C T> void f6(T x) requires D<T>();
19
20int main() {
21 f1(x);
22 f2(x);
23 f3(x);
24 f4(x);
25 f5(x);
26 f6(x);
27}
28
29template<typename T> requires C<T>() void f1(T x) { }
30template<typename T> requires C<T>() void f2(T x) { }
31template<C T> void f3(T x) { }
32template<typename T> requires C<T>() void f4(T x) requires D<T>() { }
33template<typename T> requires C<T>() and D<T>() void f5(T x) { }
34template<typename T> void f6(T x) requires C<T>() and D<T>() { }