summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2018-10-30 12:57:44 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2018-10-30 12:57:44 +0100
commit705d4574c9211760d61750eebcf5a0f30d79e6d6 (patch)
treea37636d0e3a16edab6bbc153d7de743b04eaad0c
parentd37142730a34a7bf71b9112ef6e5d3844cb78af8 (diff)
downloadsigc++-705d4574c9211760d61750eebcf5a0f30d79e6d6.tar.gz
tests: Catch exceptions by const ref
To avoid "error: catching polymorphic type ‘class std::range_error’ by value"
-rw-r--r--tests/test_exception_catch.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/test_exception_catch.cc b/tests/test_exception_catch.cc
index f8f6e02..7fd41fa 100644
--- a/tests/test_exception_catch.cc
+++ b/tests/test_exception_catch.cc
@@ -1,4 +1,3 @@
-// -*- c++ -*-
/* Copyright 2002, The libsigc++ Development Team
* Assigned to public domain. Use as you wish without restriction.
*/
@@ -54,7 +53,7 @@ struct my_catch
{
throw;
}
- catch (std::range_error e) // catch what types we know
+ catch (const std::range_error& e) // catch what types we know
{
result_stream << "caught " << e.what();
}