]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed testcases [PR98614, PR104802]
authorPatrick Palka <ppalka@redhat.com>
Thu, 16 Nov 2023 15:49:17 +0000 (10:49 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 16 Nov 2023 15:49:17 +0000 (10:49 -0500)
Both of these PRs are fixed by r12-1403-gc4e50e500da7692a.

PR c++/98614
PR c++/104802

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/nontype-auto22.C: New test.
* g++.dg/cpp2a/concepts-partial-spec14.C: New test.

gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C
new file mode 100644 (file)
index 0000000..1882d25
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/104802
+// { dg-do compile { target c++17 } }
+
+template<auto const& ... Args>
+struct S {
+  template<typename=void>
+  void operator()() const {}
+};
+
+struct weird_ {
+  int operator&() const { return 123; }
+} const weird {};
+
+int main() {
+  S<weird> s {};
+  s();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C
new file mode 100644 (file)
index 0000000..c94b401
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/98614
+// { dg-do compile { target c++20 } }
+
+template<class T>
+struct A;
+
+template<class T> requires true
+struct A<T> {
+  A(A<T> const&) = default;
+};