https://gcc.gnu.org/g:b110e092d260906432931796c1d96cba305c60e4

commit r15-4368-gb110e092d260906432931796c1d96cba305c60e4
Author: Patrick Palka <ppa...@redhat.com>
Date:   Tue Oct 15 13:43:29 2024 -0400

    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:
---
 gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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 000000000000..eb2963afcc96
--- /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<class T, class U>
+concept same_as = __is_same(T, U);
+
+template<class T>
+struct A {
+  void f(int) requires same_as<T, int>;
+  void f(...) requires (!same_as<T, int>);
+};
+
+auto fptr = &A<int>::f;
+using type = decltype(fptr);
+using type = void (A<int>::*)(int);

Reply via email to