Tested on x86_64-pc-linux-gnu, pushed as obvious. -- >8 --
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. --- gcc/testsuite/g++.dg/cpp2a/concepts-using6.C | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-using6.C diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-using6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-using6.C new file mode 100644 index 000000000000..a40519a30dae --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-using6.C @@ -0,0 +1,20 @@ +// PR c++/121351 +// { dg-do compile { target c++20 } } + +template<class T> concept C = true; + +template<class T> +struct A { + template<class U> void f(U) requires C<T>; // #1 +}; + +template<class T> +struct B : A<T*> { + using A<T*>::f; + template<class U> void f(U) requires C<T>; // #2 +}; + +int main() { + B<int> b; + b.f(42); // { dg-error "ambiguous" } #1 and #2 don't correspond +} -- 2.51.0.rc0