[PATCH] PR libstdc++/85222 allow catching iostream errors as gcc4-compatible ios::failure
Jonathan Wakely
jwakely.gcc@gmail.com
Thu Apr 12 20:55:00 GMT 2018
This fixes some comments with misspelled files and classes.
Committed to trunk and gcc-7-branch.
It occurred to me that the name of the new __ios_failure type is
visible in the verbose terminate handler messages:
terminate called after throwing an instance of 'std::__ios_failure'
what(): basic_filebuf::underflow error reading the file: Is a directory
Aborted (core dumped)
And that there's no need for this type to use a reserved name. Users
can't refer to it, or define macros that affect it (because it's never
exposed in headers).
So we could call it something else, like std::ios_failure rather than
std::__ios_failure.
Anybody got a preference they want to argue for?
-------------- next part --------------
commit a28bcba2a812d4eac6da8ce86907b670361a09a6
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Apr 12 21:28:38 2018 +0100
Fix comments that misspell names of files and classes
* src/c++11/Makefile.am: Fix comment.
* src/c++11/Makefile.in: Regenerate.
* src/c++11/cxx11-ios_failure.cc: Fix comment.
* src/c++98/ios_failure.cc: Likewise.
diff --git a/libstdc++-v3/src/c++11/Makefile.am b/libstdc++-v3/src/c++11/Makefile.am
index 6f49f0d55d3..8d524b67232 100644
--- a/libstdc++-v3/src/c++11/Makefile.am
+++ b/libstdc++-v3/src/c++11/Makefile.am
@@ -127,7 +127,7 @@ hashtable_c++0x.o: hashtable_c++0x.cc
$(CXXCOMPILE) -fimplicit-templates -c $<
if ENABLE_DUAL_ABI
-# Rewrite the type info for __dual_abi_ios_failure.
+# Rewrite the type info for __ios_failure.
rewrite_ios_failure_typeinfo = sed -e '/^_ZTISt13__ios_failure:$$/{' \
-e 'n' \
-e 's/_ZTVN10__cxxabiv120__si_class_type_infoE/_ZTVSt19__iosfail_type_info/' \
diff --git a/libstdc++-v3/src/c++11/cxx11-ios_failure.cc b/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
index 847b5946234..b1e4bfb2b44 100644
--- a/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
+++ b/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
@@ -140,7 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// __ios_failure can be upcast to the type in a catch handler.
bool
__iosfail_type_info::__do_upcast(const __class_type_info *dst_type,
- void **obj_ptr) const
+ void **obj_ptr) const
{
// If the handler is for the gcc4-compatible ios::failure type then
// catch the object stored in __ios_failure::buf instead of
@@ -150,7 +150,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*obj_ptr = static_cast<__ios_failure*>(*obj_ptr)->buf;
return true;
}
- // Otherwise proceeed as normal to see if the handler matches.
+ // Otherwise proceed as normal to see if the handler matches.
return __class_type_info::__do_upcast(dst_type, obj_ptr);
}
#else // ! __cpp_rtti
diff --git a/libstdc++-v3/src/c++98/ios_failure.cc b/libstdc++-v3/src/c++98/ios_failure.cc
index a2fc5593e15..49d24f49620 100644
--- a/libstdc++-v3/src/c++98/ios_failure.cc
+++ b/libstdc++-v3/src/c++98/ios_failure.cc
@@ -57,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if _GLIBCXX_USE_DUAL_ABI
// When the dual ABI is enabled __throw_ios_failure() is defined in
- // src/c++11/ios_failure.cc
+ // src/c++11/cxx11-ios_failure.cc
#if __cpp_rtti
// If RTTI is enabled the exception type thrown will use these functions to
// construct/destroy a gcc4-compatible ios::failure object in a buffer,
More information about the Libstdc++
mailing list