PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / diagnostic1.C
blobc977eaa8fcda93ae0881ce6754750528f75391e2
1 // PR c++/67159
2 // { dg-options "-std=c++17 -fconcepts" }
4 template <class T, class U>
5 concept bool SameAs = __is_same_as(T, U);
7 template <class T>
8 concept bool R1 = requires (T& t) {
9   { t.begin() } -> T
10   { t.end() } -> SameAs<T*>;
13 template <class T>
14 concept bool R2 = requires (T& t) {
15   { t.end() } -> SameAs<T*>;
18 struct foo {
19   int* begin();
20   int* end();
23 R1{T}
24 constexpr bool f() { return true; }
26 R2{T}
27 constexpr bool g() { return true; }
29 static_assert(f<foo>());        // { dg-error "" }
30 static_assert(g<foo>());        // { dg-error "" }