From: Marek Polacek Date: Thu, 20 Jan 2022 20:00:11 +0000 (-0500) Subject: c++: Add test for fixed PR [PR102338] X-Git-Tag: basepoints/gcc-13~1535 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30b38394b482ce894d9bc81731a0eea8711f4587;p=thirdparty%2Fgcc.git c++: Add test for fixed PR [PR102338] This was fixed by r12-6025 and is sufficiently different from noexcept71.C that I think we should add it. PR c++/102338 gcc/testsuite/ChangeLog: * g++.dg/cpp1y/noexcept2.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp1y/noexcept2.C b/gcc/testsuite/g++.dg/cpp1y/noexcept2.C new file mode 100644 index 000000000000..38dd05cd066c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/noexcept2.C @@ -0,0 +1,20 @@ +// PR c++/102338 +// { dg-do compile { target c++14 } } + +struct S { + template + static auto f(T&& t) noexcept { + return true; + } + + template + static auto f(T&& t, Ts&& ... ts) noexcept(noexcept(f(ts...))) { + return f(ts...); + } + +}; + +int main() { + S::f(true, 0, 5u); + return 0; +}