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