gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C
raw| 1 | // Example from CA 104 proposal. |
| 2 | // { dg-do compile { target concepts } } |
| 3 | |
| 4 | template <class T> concept C = sizeof(T) == 8; |
| 5 | template <class T> struct A { |
| 6 | template <class U> U f(U) requires C<typename T::type>; // #1 |
| 7 | template <class U> U f(U) requires C<T>; // #2 |
| 8 | }; |
| 9 | |
| 10 | template <> template <class U> U A<int>::f(U) requires C<int> { } // OK, specializes #2 |