From: Patrick Palka Date: Tue, 15 Oct 2024 17:43:29 +0000 (-0400) Subject: c++: add fixed testcase [PR80637] X-Git-Tag: basepoints/gcc-16~5185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b110e092d260906432931796c1d96cba305c60e4;p=thirdparty%2Fgcc.git c++: add fixed testcase [PR80637] Fixed by r15-4340-gcacbb4daac3e9a. PR c++/80637 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-fn9.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C new file mode 100644 index 00000000000..eb2963afcc9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C @@ -0,0 +1,15 @@ +// PR c++/80637 +// { dg-do compile { target c++20 } } + +template +concept same_as = __is_same(T, U); + +template +struct A { + void f(int) requires same_as; + void f(...) requires (!same_as); +}; + +auto fptr = &A::f; +using type = decltype(fptr); +using type = void (A::*)(int);