Skip to content

Commit 698c22c

Browse files
committed
Clarify usage of history variables in error messages
1 parent 2212cd6 commit 698c22c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/solvers/smt2/smt2_conv.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,18 @@ void smt2_convt::convert_expr(const exprt &expr)
24762476
out << ')';
24772477
}
24782478
}
2479+
else if(expr.id() == ID_old)
2480+
{
2481+
UNEXPECTEDCASE(
2482+
"Invalid usage of old expressions detected. old expressions must be "
2483+
"used in function contracts.");
2484+
}
2485+
else if(expr.id() == ID_loop_entry)
2486+
{
2487+
UNEXPECTEDCASE(
2488+
"Invalid usage of loop_entry expressions detected. loop_entry "
2489+
"expressions must be used in loop invariants.");
2490+
}
24792491
else
24802492
INVARIANT_WITH_DIAGNOSTICS(
24812493
false,

0 commit comments

Comments
 (0)