Skip to content

Commit 370c28b

Browse files
author
Daniel Kroening
committed
removed an assert()
1 parent 4b86dbd commit 370c28b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cpp/cpp_typecheck_conversions.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Module: C++ Language Type Checking
1616
#include <util/std_types.h>
1717
#include <util/std_expr.h>
1818
#include <util/simplify_expr.h>
19+
#include <util/invariant.h>
1920

2021
#include <ansi-c/c_qualifiers.h>
2122
#include <util/c_types.h>
@@ -46,7 +47,7 @@ bool cpp_typecheckt::standard_conversion_lvalue_to_rvalue(
4647
const exprt &expr,
4748
exprt &new_expr) const
4849
{
49-
assert(expr.get_bool(ID_C_lvalue));
50+
PRECONDITION(expr.get_bool(ID_C_lvalue));
5051

5152
if(expr.type().id()==ID_code ||
5253
expr.type().id()==ID_incomplete_struct ||
@@ -71,7 +72,7 @@ bool cpp_typecheckt::standard_conversion_array_to_pointer(
7172
const exprt &expr,
7273
exprt &new_expr) const
7374
{
74-
assert(expr.type().id()==ID_array);
75+
PRECONDITION(expr.type().id()==ID_array);
7576

7677
index_exprt index(
7778
expr,
@@ -1060,7 +1061,9 @@ bool cpp_typecheckt::user_defined_conversion_sequence(
10601061

10611062
new_expr.swap(ctor_expr);
10621063

1063-
assert(new_expr.get(ID_statement)==ID_temporary_object);
1064+
INVARIANT(
1065+
new_expr.get(ID_statement)==ID_temporary_object,
1066+
"statement");
10641067

10651068
if(to.get_bool(ID_C_constant))
10661069
new_expr.type().set(ID_C_constant, true);

0 commit comments

Comments
 (0)