From 83291b8b8c3bf457ae1b34e97028d5f744cf8654 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 16 Jan 2017 15:58:06 +0000 Subject: [PATCH] PR66145 use new ABI for std::ios::failure exceptions PR libstdc++/66145 * src/c++11/functexcept.cc: Use new ABI for std::ios_base::failure exceptions. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Don't override ABI for test, so new ios::failure can be caught. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/ exceptions_failbit.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/ exceptions_failbit.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise. * testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/ios_base/storage/2.cc: Likewise. From-SVN: r244498 --- libstdc++-v3/ChangeLog | 22 +++++++++++++++++++ libstdc++-v3/src/c++11/functexcept.cc | 5 +++-- .../27_io/basic_ios/copyfmt/char/1.cc | 3 --- .../27_io/basic_ios/exceptions/char/1.cc | 3 --- .../char/exceptions_failbit.cc | 3 --- .../wchar_t/exceptions_failbit.cc | 3 --- .../extractors_other/char/exceptions_null.cc | 3 --- .../wchar_t/exceptions_null.cc | 3 --- .../27_io/basic_istream/sentry/char/12297.cc | 3 --- .../basic_istream/sentry/wchar_t/12297.cc | 3 --- .../inserters_other/char/exceptions_null.cc | 3 --- .../wchar_t/exceptions_null.cc | 3 --- .../testsuite/27_io/ios_base/storage/2.cc | 3 --- 13 files changed, 25 insertions(+), 35 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7df1748053e..17c716a948e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,27 @@ 2017-01-16 Jonathan Wakely + PR libstdc++/66145 + * src/c++11/functexcept.cc: Use new ABI for std::ios_base::failure + exceptions. + * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Don't override ABI + for test, so new ios::failure can be caught. + * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. + * testsuite/27_io/basic_istream/extractors_arithmetic/char/ + exceptions_failbit.cc: Likewise. + * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/ + exceptions_failbit.cc: Likewise. + * testsuite/27_io/basic_istream/extractors_other/char/ + exceptions_null.cc: Likewise. + * testsuite/27_io/basic_istream/extractors_other/wchar_t/ + exceptions_null.cc: Likewise. + * testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise. + * testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise. + * testsuite/27_io/basic_ostream/inserters_other/char/ + exceptions_null.cc: Likewise. + * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ + exceptions_null.cc: Likewise. + * testsuite/27_io/ios_base/storage/2.cc: Likewise. + PR libstdc++/78702 * include/bits/locale_classes.h (locale::facet::__shim): Change from private to protected. diff --git a/libstdc++-v3/src/c++11/functexcept.cc b/libstdc++-v3/src/c++11/functexcept.cc index 3210619d65f..6281534b92a 100644 --- a/libstdc++-v3/src/c++11/functexcept.cc +++ b/libstdc++-v3/src/c++11/functexcept.cc @@ -20,8 +20,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -// We don't want to change the type thrown by __throw_ios_failure (yet?) -#define _GLIBCXX_USE_CXX11_ABI 0 +// Determines the version of ios_base::failure thrown by __throw_ios_failure. +// If !_GLIBCXX_USE_DUAL_ABI this will get undefined automatically. +#define _GLIBCXX_USE_CXX11_ABI 1 #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc index e1a30f3dad1..d922b1847bd 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc @@ -17,9 +17,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - // 27.4.4.2 basic_ios member functions // NB: Don't include any other headers in this file. diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc index df073cf094e..a7f829a19cc 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc @@ -17,9 +17,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - // 27.4.4.2 basic_ios member functions // NB: Don't include any other headers in this file. diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc index ecbbf18df25..ab4d7b139a8 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc index ebe8f70bf1e..f9537e05e44 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc index 7ff320466ed..d508f0a2823 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc index 499ed774e78..63b35706c84 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc index 50829fdebfa..bd99187580b 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc @@ -18,9 +18,6 @@ // 27.6.1.1.2 class basic_istream::sentry -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc index f56ad5543c9..86713dc021a 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - // 27.6.1.1.2 class basic_istream::sentry #include diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc index d83fe7f2605..a19cc3f80a2 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include #include diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc index ddf38db91ec..e449837b73c 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc @@ -15,9 +15,6 @@ // with this library; see the file COPYING3. If not see // . -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include #include diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc index 4a9e1201ea9..a5b9f64c66a 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc @@ -28,9 +28,6 @@ // Radar 6467884: 10.X systems are not robust when paging space is exceeded // { dg-skip-if "" { *-*-darwin* && lp64 } { "*" } { "" } } -// The library still throws the original definition of std::ios::failure -// { dg-options "-D_GLIBCXX_USE_CXX11_ABI=0" } - #include #include #include -- 2.30.2