From 07758b7af8b41422168387bc59d31ac0cdd095ac Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 22 Dec 2017 16:58:15 +0000 Subject: [PATCH] Catch exceptions by reference --- test/exception/swap_exception_tests.cpp | 2 +- test/unordered/at_tests.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/exception/swap_exception_tests.cpp b/test/exception/swap_exception_tests.cpp index 242410d7..b2bec836 100644 --- a/test/exception/swap_exception_tests.cpp +++ b/test/exception/swap_exception_tests.cpp @@ -90,7 +90,7 @@ template struct swap_base : public test::exception_base { try { d.x.swap(d.y); - } catch (std::runtime_error) { + } catch (std::runtime_error&) { } DISABLE_EXCEPTIONS; diff --git a/test/unordered/at_tests.cpp b/test/unordered/at_tests.cpp index 4d91975c..25b0951a 100644 --- a/test/unordered/at_tests.cpp +++ b/test/unordered/at_tests.cpp @@ -25,13 +25,13 @@ namespace at_tests { try { x.at("one"); BOOST_ERROR("Should have thrown."); - } catch (std::out_of_range) { + } catch (std::out_of_range&) { } try { x_const.at("one"); BOOST_ERROR("Should have thrown."); - } catch (std::out_of_range) { + } catch (std::out_of_range&) { } BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Add elements" << std::endl; @@ -51,13 +51,13 @@ namespace at_tests { try { x.at("three"); BOOST_ERROR("Should have thrown."); - } catch (std::out_of_range) { + } catch (std::out_of_range&) { } try { x_const.at("three"); BOOST_ERROR("Should have thrown."); - } catch (std::out_of_range) { + } catch (std::out_of_range&) { } BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Finished" << std::endl;