From 3f6400b40e747c7de5dc42f30e8e3a6b6de033ae Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 4 Dec 2017 11:55:51 +0100 Subject: [PATCH] Fix a warning [-Wcatch-value] ``` test/Polyhedron_Demo/MainWindow.cpp:1075:26: warning: catching polymorphic type 'class std::logic_error' by value [-Wcatch-value=] test/Polyhedron_Demo/Plugins/Mesh_2/Mesh_2_plugin.cpp:287:6: warning: catching polymorphic type 'class std::runtime_error' by value [-Wcatch-value=] ``` --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 +- Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 6406d45c9ba..41291457b1d 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1071,7 +1071,7 @@ bool MainWindow::open(QString filename, QString loader_name) { if(!item_opt) return false; else item = *item_opt; } - catch(std::logic_error e) { + catch(std::logic_error& e) { std::cerr << e.what() << std::endl; return false; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index d77d14eb97c..527ec779993 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -284,7 +284,7 @@ private: Q_FOREACH(const std::vector& points, polylines_item->polylines) cdt.insert_constraint(points.begin(),points.end()); - }catch(std::runtime_error) + }catch(std::runtime_error&) { QApplication::restoreOverrideCursor(); throw;