aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2022-01-20 15:00:11 -0500
committerMarek Polacek <polacek@redhat.com>2022-01-20 15:02:21 -0500
commit30b38394b482ce894d9bc81731a0eea8711f4587 (patch)
treeddcbde67392720efe421727abc56188a6130fbba /gcc
parent2f34d7ef3d026cf7109b6e6bb2eca14c840e7c71 (diff)
downloadgcc-30b38394b482ce894d9bc81731a0eea8711f4587.zip
gcc-30b38394b482ce894d9bc81731a0eea8711f4587.tar.gz
gcc-30b38394b482ce894d9bc81731a0eea8711f4587.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/noexcept2.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1y/noexcept2.C b/gcc/testsuite/g++.dg/cpp1y/noexcept2.C
new file mode 100644
index 0000000..38dd05c
--- /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<typename T>
+ static auto f(T&& t) noexcept {
+ return true;
+ }
+
+ template<typename T, typename... Ts>
+ static auto f(T&& t, Ts&& ... ts) noexcept(noexcept(f(ts...))) {
+ return f(ts...);
+ }
+
+};
+
+int main() {
+ S::f(true, 0, 5u);
+ return 0;
+}