[Bug libstdc++/85222] [7 Regression] ABI breakage of __throw_ios_failure by r244498

2018-08-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85222

--- Comment #24 from Jonathan Wakely  ---
Author: redi
Date: Wed Aug  8 15:40:11 2018
New Revision: 263414

URL: https://gcc.gnu.org/viewcvs?rev=263414&root=gcc&view=rev
Log:
PR libstdc++/66145 allow catching iostream errors as cxx11 ios::failure

Define a new exception type derived from the gcc4-compatible ios::failure
which also aggregates an object of the ios::failure[abi:cxx11] type.
Make __throw_ios_failure throw this new type for iostream errors
that raise exceptions. Provide custom type info for the new type so that
it can be caught by handlers for ios::failure[abi:cxx11] type
as well as handlers for the gcc4-compatible ios::failure and its bases.

Backport from mainline
2018-04-10  Jonathan Wakely  

PR libstdc++/85222
* src/c++11/cxx11-ios_failure.cc (__construct_ios_failure)
(__destroy_ios_failure, is_ios_failure_handler): New functions.
* src/c++11/ios.cc (__throw_ios_failure): Remove definition.
(_GLIBCXX_USE_CXX11_ABI): Don't define here.
* src/c++98/Makefile.am [ENABLE_DUAL_ABI]: Add special rules for
ios_failure.cc to rewrite type info for __ios_failure.
* src/c++98/Makefile.in: Regenerate.
* src/c++98/ios_failure.cc [_GLIBCXX_USE_DUAL_ABI]
(__iosfailure, __iosfailure_type_info): New types.
(__throw_ios_failure): Define here.
* testsuite/27_io/ios_base/failure/dual_abi.cc: New.
* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Revert changes to
add -D_GLIBCXX_USE_CXX11_ABI=0 to dg-options.
* 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.

Added:
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/ios_base/failure/dual_abi.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
branches/gcc-6-branch/libstdc++-v3/src/c++11/ios.cc
branches/gcc-6-branch/libstdc++-v3/src/c++98/Makefile.am
branches/gcc-6-branch/libstdc++-v3/src/c++98/Makefile.in
branches/gcc-6-branch/libstdc++-v3/src/c++98/ios_failure.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc

[Bug libstdc++/85222] [7 Regression] ABI breakage of __throw_ios_failure by r244498

2018-04-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85222

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #23 from Jonathan Wakely  ---
Fixed for 7.4 and 8.1

[Bug libstdc++/85222] [7 Regression] ABI breakage of __throw_ios_failure by r244498

2018-04-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85222

--- Comment #22 from Jonathan Wakely  ---
Author: redi
Date: Thu Apr 12 19:06:50 2018
New Revision: 259352

URL: https://gcc.gnu.org/viewcvs?rev=259352&root=gcc&view=rev
Log:
PR libstdc++/85222 allow catching iostream errors as gcc4-compatible
ios::failure

Define a new exception type derived from std::ios::failure[abi:cxx11]
which also aggregates an object of the gcc4-compatible ios::failure
type. Make __throw_ios_failure throw this new type for iostream errors
that raise exceptions. Provide custom type info for the new type so that
it can be caught by handlers for the gcc4-compatible ios::failure type
as well as handlers for ios::failure[abi:cxx11] and its bases.

Backport from mainline
2018-04-10  Jonathan Wakely  

PR libstdc++/85222
* src/c++11/Makefile.am [ENABLE_DUAL_ABI]: Add special rules for
cxx11-ios_failure.cc to rewrite type info for __ios_failure.
* src/c++11/Makefile.in: Regenerate.
* src/c++11/cxx11-ios_failure.cc (__ios_failure, __iosfail_type_info):
New types.
[_GLIBCXX_USE_DUAL_ABI] (__throw_ios_failure): Define here.
* src/c++11/ios.cc (__throw_ios_failure): Remove definition.
(_GLIBCXX_USE_CXX11_ABI): Don't define here.
* src/c++98/ios_failure.cc (__construct_ios_failure)
(__destroy_ios_failure, is_ios_failure_handler): New functions.
[!_GLIBCXX_USE_DUAL_ABI] (__throw_ios_failure): Define here.
* testsuite/27_io/ios_base/failure/dual_abi.cc: New.
* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Revert changes to
handler types, to always catch std::ios_base::failure.
* 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.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/ios_base/failure/dual_abi.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/src/c++11/Makefile.am
branches/gcc-7-branch/libstdc++-v3/src/c++11/Makefile.in
branches/gcc-7-branch/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
branches/gcc-7-branch/libstdc++-v3/src/c++11/ios.cc
branches/gcc-7-branch/libstdc++-v3/src/c++98/ios_failure.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc
branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc