[gcc r14-8401] c++: add test [PR113347]
Jason Merrill
jason@gcc.gnu.org
Wed Jan 24 19:42:33 GMT 2024
https://gcc.gnu.org/g:aedfdd340cbb4a97a8f6d432720a4df374c1e467
commit r14-8401-gaedfdd340cbb4a97a8f6d432720a4df374c1e467
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jan 23 16:09:15 2024 -0500
c++: add test [PR113347]
The patch for this PR is unneeded on trunk, but let's add the test.
PR c++/113347
gcc/testsuite/ChangeLog:
* g++.dg/eh/return3.C: New test.
Diff:
---
gcc/testsuite/g++.dg/eh/return3.C | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gcc/testsuite/g++.dg/eh/return3.C b/gcc/testsuite/g++.dg/eh/return3.C
new file mode 100644
index 00000000000..76aa50d523d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/return3.C
@@ -0,0 +1,17 @@
+// PR c++/113347
+
+#if __cplusplus < 201103L
+#define THROWS
+#else
+#define THROWS noexcept(false)
+#endif
+
+struct A { ~A(); };
+struct B { ~B() THROWS; };
+
+A f()
+{
+ A a;
+ return a;
+ B();
+}
More information about the Gcc-cvs
mailing list