aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-11-16 10:49:17 -0500
committerPatrick Palka <ppalka@redhat.com>2023-11-16 10:49:17 -0500
commit063d987af0e7a8329559fb116337bdb8ab20d8eb (patch)
tree8e63cbe50c1ad877ecf21a1a980ca6bf1fabe0ee
parent0077c0fb19981c108a01cd15af9b2d6d478c183b (diff)
downloadgcc-063d987af0e7a8329559fb116337bdb8ab20d8eb.zip
gcc-063d987af0e7a8329559fb116337bdb8ab20d8eb.tar.gz
gcc-063d987af0e7a8329559fb116337bdb8ab20d8eb.tar.bz2
c++: add fixed testcases [PR98614, PR104802]
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.
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C10
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C
new file mode 100644
index 0000000..1882d25
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C
@@ -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
index 0000000..c94b401
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C
@@ -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;
+};