From: Patrick Palka Date: Thu, 16 Nov 2023 15:49:17 +0000 (-0500) Subject: c++: add fixed testcases [PR98614, PR104802] X-Git-Tag: basepoints/gcc-15~4607 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=063d987af0e7a8329559fb116337bdb8ab20d8eb;p=thirdparty%2Fgcc.git 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. --- 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 000000000000..1882d2586d55 --- /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 +struct S { + template + void operator()() const {} +}; + +struct weird_ { + int operator&() const { return 123; } +} const weird {}; + +int main() { + S 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 000000000000..c94b4013340a --- /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 +struct A; + +template requires true +struct A { + A(A const&) = default; +};