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