Document the whole story behind catchiofailure.cpp

consistent_macro_prefix
Martchus 5 years ago
parent 51e87f3740
commit 64be5bce63
  1. 14
      io/catchiofailure.cpp

@ -4,6 +4,7 @@
#include <cstddef>
// ensure the old ABI is used under libstd++ < 7 and the new ABI under libstd++ >= 7
// (because libstdc++ < 7 throws the old ios_base::failure and libstdc++ >= 7 the new one)
#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7
#undef _GLIBCXX_USE_CXX11_ABI
#define _GLIBCXX_USE_CXX11_ABI 1
@ -21,6 +22,16 @@ namespace IoUtilities {
* \brief Provides a workaround for GCC Bug 66145.
* \returns Returns the error message.
* \throws Throws the current exception if it is not std::ios_base::failure.
* \remarks
* - GCC Bug 66145 is "resolved", but the story continues with GCC Bug 85222.
* - However, the bug finally got fixed for 7.4 and 8.1 so this workaround can be
* dropped in the next major release which also drops support for older libstdc++
* versions.
* \sa
* - initial bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145
* - change introduced in libstdc++ 7: https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/src/c%2B%2B11/functexcept.cc?r1=244498&r2=244497&pathrev=244498
* - follow-up bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85222
* - final fix: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=259352
*/
const char *catchIoFailure()
{
@ -32,7 +43,8 @@ const char *catchIoFailure()
}
/*!
* \brief Throws a std::ios_base::failure with the specified message.
* \brief Throws an std::ios_base::failure with the specified message.
* \sa catchIoFailure()
*/
void throwIoFailure(const char *what)
{

Loading…
Cancel
Save