diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2018-10-30 12:57:44 +0100 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2018-10-30 12:57:44 +0100 |
commit | 705d4574c9211760d61750eebcf5a0f30d79e6d6 (patch) | |
tree | a37636d0e3a16edab6bbc153d7de743b04eaad0c | |
parent | d37142730a34a7bf71b9112ef6e5d3844cb78af8 (diff) | |
download | sigc++-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.cc | 3 |
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(); } |