From: Patrick Palka Date: Mon, 4 Aug 2025 21:09:28 +0000 (-0400) Subject: c++: add another testcase [PR121351] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9da8541c4acfc0a65f574bace6ca160bf70cc01;p=thirdparty%2Fgcc.git 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. --- 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 00000000000..a40519a30da --- /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 concept C = true; + +template +struct A { + template void f(U) requires C; // #1 +}; + +template +struct B : A { + using A::f; + template void f(U) requires C; // #2 +}; + +int main() { + B b; + b.f(42); // { dg-error "ambiguous" } #1 and #2 don't correspond +}