aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2007-05-07 17:27:54 -0400
committerJason Merrill <jason@gcc.gnu.org>2007-05-07 17:27:54 -0400
commitd05f74f16e130e97210ad2eaad12915192ea8c9e (patch)
treec30258339d2a08a69bc22ef35afceb0e8fe1957c /gcc
parent1e7c1ba87df3e201199408f4cef5cbd0aaad475a (diff)
downloadgcc-d05f74f16e130e97210ad2eaad12915192ea8c9e.zip
gcc-d05f74f16e130e97210ad2eaad12915192ea8c9e.tar.gz
gcc-d05f74f16e130e97210ad2eaad12915192ea8c9e.tar.bz2
re PR other/28145 (C++ (throw() and catch(...) {/* fall through */ } ) and pthread cancellation are incompatible (at least with NPTL))
PR c++/28145 * libsupc++/cxxabi.h (__forced_unwind, __foreign_exception): New classes. * libsupc++/eh_exception.cc: Define their destructors. * config/abi/pre/gnu.ver: Export their type_infos. * config/abi/pre/gnu-versioned-namespace.ver: Likewise. * libsupc++/eh_personality.cc: A handler for abi::__forced_unwind matches a forced unwind, and a handler for abi::__foreign_exception matches a foreign exception. * include/bits/istream.tcc: Rethrow forced unwind. * include/bits/ostream.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/basic_string.tcc (operator>>, getline): Likewise. * include/bits/fstream.tcc (basic_filebuf::close): Likewise. * include/ext/vstring.cc (operator>>, getline): Likewise. * src/istream.cc: Likewise. * src/compatibility.cc (basic_istream::ignore): Likewise. * include/std/bitset (operator>>): Likewise. * include/std/fstream (basic_filebuf::close): Remove throw() spec. * libsupc++/cxxabi-internal.h: Split out from... * libsupc++/cxxabi.h: ...here. From-SVN: r124517
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/abi/forced.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C
new file mode 100644
index 0000000..7a9c359
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/forced.C
@@ -0,0 +1,25 @@
+// This test only applies to glibc (NPTL) targets.
+// { dg-do run { target *-*-linux* } }
+// { dg-options "-pthread" }
+
+#include <pthread.h>
+#include <cxxabi.h>
+extern "C" int printf (const char *, ...);
+
+int main()
+{
+ try
+ {
+ pthread_exit (0);
+ }
+ catch (abi::__forced_unwind &)
+ {
+ printf ("caught forced unwind\n");
+ throw;
+ }
+ catch (...)
+ {
+ printf ("caught ...\n");
+ return 1;
+ }
+}