]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed testcase [PR80637]
authorPatrick Palka <ppalka@redhat.com>
Tue, 15 Oct 2024 17:43:29 +0000 (13:43 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 15 Oct 2024 17:43:29 +0000 (13:43 -0400)
Fixed by r15-4340-gcacbb4daac3e9a.

PR c++/80637

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-fn9.C: New test.

gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn9.C
new file mode 100644 (file)
index 0000000..eb2963a
--- /dev/null
@@ -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);