diff --git a/src/api/api_solver.cpp b/src/api/api_solver.cpp index a7bb5a627..0bf74b840 100644 --- a/src/api/api_solver.cpp +++ b/src/api/api_solver.cpp @@ -100,9 +100,7 @@ extern "C" { solver2smt2_pp::solver2smt2_pp(ast_manager& m, char const* file): m_pp_util(m), m_out(file) { if (!m_out) { - std::string msg; - msg = msg + "could not open " + file + " for output"; - throw default_exception(msg.c_str()); + throw default_exception("could not open " + std::string(file) + " for output"); } } diff --git a/src/api/z3_replayer.cpp b/src/api/z3_replayer.cpp index e898f2720..09cc8bba4 100644 --- a/src/api/z3_replayer.cpp +++ b/src/api/z3_replayer.cpp @@ -79,7 +79,7 @@ struct z3_replayer::imp { strm << "expecting " << kind2string(k) << " at position " << pos << " but got " << kind2string(m_args[pos].m_kind); TRACE("z3_replayer", tout << strm.str() << "\n";); - throw z3_replayer_exception(strm.str().c_str()); + throw z3_replayer_exception(strm.str()); } } diff --git a/src/sat/sat_solver.cpp b/src/sat/sat_solver.cpp index 9a1f9c01d..ea283895c 100644 --- a/src/sat/sat_solver.cpp +++ b/src/sat/sat_solver.cpp @@ -1464,7 +1464,7 @@ namespace sat { if (finished_id == -1) { switch (ex_kind) { case ERROR_EX: throw z3_error(error_code); - default: throw default_exception(ex_msg.c_str()); + default: throw default_exception(std::move(ex_msg)); } } return result;