From 23cc940743abb65675d7f4a4f999c6967a075cc8 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sat, 25 Feb 2017 14:38:38 +0100 Subject: [PATCH] gcc fails to catch std::ios_base::failure due to an inconsistent C++11 ABI between headers and libraries. See bug#66145 for more details (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145). --- simgear/io/iostreams/zlibstream_test.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/simgear/io/iostreams/zlibstream_test.cxx b/simgear/io/iostreams/zlibstream_test.cxx index aa63cb0d..f9f1fabf 100644 --- a/simgear/io/iostreams/zlibstream_test.cxx +++ b/simgear/io/iostreams/zlibstream_test.cxx @@ -428,6 +428,14 @@ void test_ZlibDecompressorIStream_readPutbackEtc() decompressor.putback('Z'); } catch (std::ios_base::failure) { gotException = true; + } catch (const std::exception& e) { + // gcc fails to catch std::ios_base::failure due to an inconsistent C++11 + // ABI between headers and libraries. See bug#66145 for more details. + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145 + if (!strcmp(e.what(), "basic_ios::clear")) + gotException = true; + else + throw e; } SG_VERIFY(gotException && decompressor.bad()); }