gcc/testsuite/g++.dg/cpp2a/concepts-using5a.C
raw| 1 | // PR c++/121351 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // A version of concepts-using5a.C where B instead of A is a template. |
| 4 | |
| 5 | template<class T> concept C = true; |
| 6 | |
| 7 | struct A { |
| 8 | template<class U> void f(U) requires C<int> = delete; // #1 |
| 9 | }; |
| 10 | |
| 11 | template<class T> |
| 12 | struct B : A { |
| 13 | using A::f; |
| 14 | template<class U> void f(U) requires C<T>; // #2 |
| 15 | }; |
| 16 | |
| 17 | int main() { |
| 18 | B<int> b; |
| 19 | b.f(42); // OK, #2 corresponds to and therefore hides #1 |
| 20 | } |