From ca72cca457f5f1afedb420aa1e1fb197812f3c48 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 28 Nov 2016 09:52:44 +0100 Subject: [PATCH] Fix for FED24 compilation. Mix up between C++11 and C++98 exception. --- .../InterpKernelGeo2DQuadraticPolygon.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx index bc7016198..9cfb34075 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx @@ -60,9 +60,24 @@ QuadraticPolygon::QuadraticPolygon(const char *file) } while(1); } - catch(std::ifstream::failure&) + catch(const std::ifstream::failure&) { } + catch(const std::exception & ex) + { + // Some code before this catch throws the C++98 version of the exception (mangled + // name is " NSt8ios_base7failureE"), but FED24 compilation of the current version of the code + // tries to catch the C++11 version of it (mangled name "NSt8ios_base7failureB5cxx11E"). + // So we have this nasty hack to catch both versions ... + + // TODO: the below should be replaced by a better handling avoiding exception throwing. + if (std::string(ex.what()) == "basic_ios::clear") + { + //std::cout << "std::ios_base::failure C++11\n"; + } + else + throw ex; + } front()->changeStartNodeWith(back()->getEndNode()); } -- 2.39.2