Skip to content

Commit b9da854

Browse files
author
Patrick Palka
committed
c++: add another testcase [PR121351]
Here's a previously accepted testcase that is now ambiguous after r16-2771-gb9f1cc4e119da, since the uninstantiated constraints are equivalent but the partially instantiated constraints aren't, so the two member functions no longer correspond. PR c++/121351 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-using6.C: New test.
1 parent b9f1cc4 commit b9da854

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
template<class U> void f(U) requires C<T>; // #1
9+
};
10+
11+
template<class T>
12+
struct B : A<T*> {
13+
using A<T*>::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); // { dg-error "ambiguous" } #1 and #2 don't correspond
20+
}

0 commit comments

Comments
 (0)