mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 21:03:39 +00:00
As of GCC8, the throw by value, catch by reference idiom is enforced via -Wcatch-value
This commit is contained in:
parent
5134c16833
commit
f02d031d11
7 changed files with 19 additions and 19 deletions
|
@ -395,7 +395,7 @@ class set_option_cmd : public set_get_option_cmd {
|
||||||
env_params::updt_params();
|
env_params::updt_params();
|
||||||
ctx.global_params_updated();
|
ctx.global_params_updated();
|
||||||
}
|
}
|
||||||
catch (gparams::exception ex) {
|
catch (const gparams::exception & ex) {
|
||||||
throw cmd_exception(ex.msg());
|
throw cmd_exception(ex.msg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -620,7 +620,7 @@ public:
|
||||||
try {
|
try {
|
||||||
ctx.regular_stream() << gparams::get_value(opt) << std::endl;
|
ctx.regular_stream() << gparams::get_value(opt) << std::endl;
|
||||||
}
|
}
|
||||||
catch (gparams::exception ex) {
|
catch (const gparams::exception & ex) {
|
||||||
ctx.print_unsupported(opt, m_line, m_pos);
|
ctx.print_unsupported(opt, m_line, m_pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -912,7 +912,7 @@ public:
|
||||||
if(!add_local_antes(arg, hyps, dk == PR_UNIT_RESOLUTION && i == 0))
|
if(!add_local_antes(arg, hyps, dk == PR_UNIT_RESOLUTION && i == 0))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (non_lit_local_ante) {
|
catch (const non_lit_local_ante &) {
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
show_step(proof);
|
show_step(proof);
|
||||||
show(conc(proof));
|
show(conc(proof));
|
||||||
|
@ -1138,7 +1138,7 @@ public:
|
||||||
try {
|
try {
|
||||||
res = iproof->make_resolution(pnode,neg,pos);
|
res = iproof->make_resolution(pnode,neg,pos);
|
||||||
}
|
}
|
||||||
catch (const iz3proof::proof_error){
|
catch (const iz3proof::proof_error &){
|
||||||
std::cout << "\nresolution error in theory lemma\n";
|
std::cout << "\nresolution error in theory lemma\n";
|
||||||
std::cout << "lits:\n";
|
std::cout << "lits:\n";
|
||||||
for(unsigned j = 0; j < lits.size(); j++)
|
for(unsigned j = 0; j < lits.size(); j++)
|
||||||
|
@ -1212,7 +1212,7 @@ public:
|
||||||
try {
|
try {
|
||||||
res = iproof->make_resolution(pnode,neg,pos);
|
res = iproof->make_resolution(pnode,neg,pos);
|
||||||
}
|
}
|
||||||
catch (const iz3proof::proof_error){
|
catch (const iz3proof::proof_error &){
|
||||||
std::cout << "\nresolution error in theory lemma\n";
|
std::cout << "\nresolution error in theory lemma\n";
|
||||||
std::cout << "lits:\n";
|
std::cout << "lits:\n";
|
||||||
for(unsigned j = 0; j < lits.size(); j++)
|
for(unsigned j = 0; j < lits.size(); j++)
|
||||||
|
@ -1418,7 +1418,7 @@ public:
|
||||||
try {
|
try {
|
||||||
return iproof->make_resolution(pnode,neg,pos);
|
return iproof->make_resolution(pnode,neg,pos);
|
||||||
}
|
}
|
||||||
catch (const iz3proof::proof_error){
|
catch (const iz3proof::proof_error &){
|
||||||
std::cout << "resolution error in unit_resolution, position" << position << "\n";
|
std::cout << "resolution error in unit_resolution, position" << position << "\n";
|
||||||
show_step(proof);
|
show_step(proof);
|
||||||
throw invalid_lemma();
|
throw invalid_lemma();
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace subpaving {
|
||||||
int2mpf(c, m_c);
|
int2mpf(c, m_c);
|
||||||
return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
||||||
}
|
}
|
||||||
catch (f2n<mpf_manager>::exception) {
|
catch (const f2n<mpf_manager>::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ namespace subpaving {
|
||||||
m.set(m_c, k);
|
m.set(m_c, k);
|
||||||
return reinterpret_cast<ineq*>(m_ctx.mk_ineq(x, m_c, lower, open));
|
return reinterpret_cast<ineq*>(m_ctx.mk_ineq(x, m_c, lower, open));
|
||||||
}
|
}
|
||||||
catch (f2n<mpf_manager>::exception) {
|
catch (const f2n<mpf_manager>::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ namespace subpaving {
|
||||||
int2hwf(c, m_c);
|
int2hwf(c, m_c);
|
||||||
return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
||||||
}
|
}
|
||||||
catch (f2n<mpf_manager>::exception) {
|
catch (const f2n<mpf_manager>::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ namespace subpaving {
|
||||||
m.set(m_c, k);
|
m.set(m_c, k);
|
||||||
return reinterpret_cast<ineq*>(m_ctx.mk_ineq(x, m_c, lower, open));
|
return reinterpret_cast<ineq*>(m_ctx.mk_ineq(x, m_c, lower, open));
|
||||||
}
|
}
|
||||||
catch (f2n<mpf_manager>::exception) {
|
catch (const f2n<mpf_manager>::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ namespace subpaving {
|
||||||
int2fpoint(c, m_c);
|
int2fpoint(c, m_c);
|
||||||
return this->m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
return this->m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
|
||||||
}
|
}
|
||||||
catch (typename context_fpoint::numeral_manager::exception) {
|
catch (const typename context_fpoint::numeral_manager::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ namespace subpaving {
|
||||||
m.set(m_c, m_qm, k);
|
m.set(m_c, m_qm, k);
|
||||||
return reinterpret_cast<ineq*>(this->m_ctx.mk_ineq(x, m_c, lower, open));
|
return reinterpret_cast<ineq*>(this->m_ctx.mk_ineq(x, m_c, lower, open));
|
||||||
}
|
}
|
||||||
catch (typename context_fpoint::numeral_manager::exception) {
|
catch (const typename context_fpoint::numeral_manager::exception &) {
|
||||||
throw subpaving::exception();
|
throw subpaving::exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1310,7 +1310,7 @@ bool context_t<C>::relevant_new_bound(var x, numeral const & k, bool lower, bool
|
||||||
TRACE("subpaving_relevant_bound", tout << "new bound is relevant\n";);
|
TRACE("subpaving_relevant_bound", tout << "new bound is relevant\n";);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (typename C::exception) {
|
catch (const typename C::exception &) {
|
||||||
// arithmetic module failed.
|
// arithmetic module failed.
|
||||||
set_arith_failed();
|
set_arith_failed();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1722,7 +1722,7 @@ void context_t<C>::propagate(node * n, bound * b) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (typename C::exception) {
|
catch (const typename C::exception &) {
|
||||||
// arithmetic module failed, ignore constraint
|
// arithmetic module failed, ignore constraint
|
||||||
set_arith_failed();
|
set_arith_failed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ unsigned read_datalog(char const * file) {
|
||||||
false);
|
false);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (out_of_memory_error) {
|
catch (const out_of_memory_error &) {
|
||||||
std::cout << "\n\nOUT OF MEMORY!\n\n";
|
std::cout << "\n\nOUT OF MEMORY!\n\n";
|
||||||
display_statistics(
|
display_statistics(
|
||||||
std::cout,
|
std::cout,
|
||||||
|
|
|
@ -1522,7 +1522,7 @@ public:
|
||||||
}
|
}
|
||||||
SASSERT(ref_count(r) >= 1);
|
SASSERT(ref_count(r) >= 1);
|
||||||
}
|
}
|
||||||
catch (aig_exception ex) {
|
catch (const aig_exception & ex) {
|
||||||
dec_ref(r);
|
dec_ref(r);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ static void tst1() {
|
||||||
std::cout << i << ": " << a << "\n";
|
std::cout << i << ": " << a << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (const z3_exception & ex) {
|
||||||
std::cout << ex.msg() << "\n";
|
std::cout << ex.msg() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ static void tst_limits(unsigned prec) {
|
||||||
m.round_to_plus_inf();
|
m.round_to_plus_inf();
|
||||||
bool overflow = false;
|
bool overflow = false;
|
||||||
try { m.inc(a); }
|
try { m.inc(a); }
|
||||||
catch (mpff_manager::overflow_exception) { overflow = true; }
|
catch (const mpff_manager::overflow_exception &) { overflow = true; }
|
||||||
VERIFY(overflow);
|
VERIFY(overflow);
|
||||||
m.set_max(a);
|
m.set_max(a);
|
||||||
m.dec(a);
|
m.dec(a);
|
||||||
|
@ -446,7 +446,7 @@ static void tst_limits(unsigned prec) {
|
||||||
ENSURE(m.eq(a, b));
|
ENSURE(m.eq(a, b));
|
||||||
overflow = true;
|
overflow = true;
|
||||||
try { m.dec(a); }
|
try { m.dec(a); }
|
||||||
catch (mpff_manager::overflow_exception) { overflow = true; }
|
catch (const mpff_manager::overflow_exception &) { overflow = true; }
|
||||||
ENSURE(overflow);
|
ENSURE(overflow);
|
||||||
m.round_to_plus_inf();
|
m.round_to_plus_inf();
|
||||||
m.set_min(a);
|
m.set_min(a);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue