diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 5ad4f8232fe..b83459fbd7c 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -434,7 +434,7 @@ int cbmc_parse_optionst::doit() return 6; // should contemplate EX_SOFTWARE from sysexits.h } - catch(const std::string error_msg) + catch(const std::string &error_msg) { error() << error_msg << eom; return 6; // should contemplate EX_SOFTWARE from sysexits.h @@ -586,7 +586,7 @@ bool cbmc_parse_optionst::set_properties() return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; @@ -648,7 +648,7 @@ int cbmc_parse_optionst::get_goto_program( return 6; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return 6; @@ -708,7 +708,7 @@ void cbmc_parse_optionst::preprocessing() error() << e << eom; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; } @@ -840,7 +840,7 @@ bool cbmc_parse_optionst::process_goto_program( return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; diff --git a/src/clobber/clobber_parse_options.cpp b/src/clobber/clobber_parse_options.cpp index 9a687b32529..f3c35b6f8e4 100644 --- a/src/clobber/clobber_parse_options.cpp +++ b/src/clobber/clobber_parse_options.cpp @@ -154,7 +154,7 @@ int clobber_parse_optionst::doit() return 0; } - catch(const std::string error_msg) + catch(const std::string &error_msg) { error() << error_msg << messaget::eom; return 8; diff --git a/src/goto-analyzer/goto_analyzer_parse_options.cpp b/src/goto-analyzer/goto_analyzer_parse_options.cpp index 34fd8c8d0ad..54ed0ab5408 100644 --- a/src/goto-analyzer/goto_analyzer_parse_options.cpp +++ b/src/goto-analyzer/goto_analyzer_parse_options.cpp @@ -321,7 +321,7 @@ bool goto_analyzer_parse_optionst::set_properties() return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; @@ -403,7 +403,7 @@ bool goto_analyzer_parse_optionst::process_goto_program( return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; diff --git a/src/goto-cc/goto_cc_mode.cpp b/src/goto-cc/goto_cc_mode.cpp index 483f3340967..b6802103f30 100644 --- a/src/goto-cc/goto_cc_mode.cpp +++ b/src/goto-cc/goto_cc_mode.cpp @@ -88,7 +88,7 @@ int goto_cc_modet::main(int argc, const char **argv) return EX_SOFTWARE; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return EX_SOFTWARE; diff --git a/src/goto-diff/goto_diff_parse_options.cpp b/src/goto-diff/goto_diff_parse_options.cpp index dc3ebca4c71..d439f1b9aa0 100644 --- a/src/goto-diff/goto_diff_parse_options.cpp +++ b/src/goto-diff/goto_diff_parse_options.cpp @@ -449,7 +449,7 @@ bool goto_diff_parse_optionst::process_goto_program( return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; diff --git a/src/goto-instrument/goto_instrument_parse_options.cpp b/src/goto-instrument/goto_instrument_parse_options.cpp index 65925406098..27f87141fd3 100644 --- a/src/goto-instrument/goto_instrument_parse_options.cpp +++ b/src/goto-instrument/goto_instrument_parse_options.cpp @@ -813,7 +813,7 @@ int goto_instrument_parse_optionst::doit() return 11; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return 11; diff --git a/src/goto-programs/initialize_goto_model.cpp b/src/goto-programs/initialize_goto_model.cpp index 5461c9015ee..1cdc67ef43f 100644 --- a/src/goto-programs/initialize_goto_model.cpp +++ b/src/goto-programs/initialize_goto_model.cpp @@ -184,7 +184,7 @@ bool initialize_goto_model( msg.error() << e << messaget::eom; return true; } - catch(const std::string e) + catch(const std::string &e) { msg.error() << e << messaget::eom; return true; diff --git a/src/jbmc/jbmc_parse_options.cpp b/src/jbmc/jbmc_parse_options.cpp index 9122c96cbd4..133e0aa3187 100644 --- a/src/jbmc/jbmc_parse_options.cpp +++ b/src/jbmc/jbmc_parse_options.cpp @@ -413,7 +413,7 @@ int jbmc_parse_optionst::doit() return 6; // should contemplate EX_SOFTWARE from sysexits.h } - catch(const std::string error_msg) + catch(const std::string &error_msg) { error() << error_msg << eom; return 6; // should contemplate EX_SOFTWARE from sysexits.h @@ -546,7 +546,7 @@ bool jbmc_parse_optionst::set_properties() return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; @@ -608,7 +608,7 @@ int jbmc_parse_optionst::get_goto_program( return 6; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return 6; @@ -772,7 +772,7 @@ bool jbmc_parse_optionst::process_goto_program( return true; } - catch(const std::string e) + catch(const std::string &e) { error() << e << eom; return true; diff --git a/src/memory-models/mmcc_parse_options.cpp b/src/memory-models/mmcc_parse_options.cpp index 8fae9244839..03644ab95f5 100644 --- a/src/memory-models/mmcc_parse_options.cpp +++ b/src/memory-models/mmcc_parse_options.cpp @@ -64,7 +64,7 @@ int mmcc_parse_optionst::doit() std::cerr << error << '\n'; return 10; } - catch(const std::string error) + catch(const std::string &error) { std::cerr << error << '\n'; return 10; diff --git a/unit/testing-utils/catch.hpp b/unit/testing-utils/catch.hpp index 45328b8545c..511816748fa 100644 --- a/unit/testing-utils/catch.hpp +++ b/unit/testing-utils/catch.hpp @@ -7326,7 +7326,7 @@ namespace Catch { catch( std::exception& ex ) { return ex.what(); } - catch( std::string& msg ) { + catch(const std::string &msg) { return msg; } catch( const char* msg ) {