Skip to content

Use narrow instead of numeric_cast on std::size_t #4354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/solvers/prop/bdd_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ Author: Michael Tautschnig, [email protected]

#include "bdd_expr.h"

#include <util/arith_tools.h>
#include <util/expr_util.h>
#include <util/format_expr.h>
#include <util/invariant.h>
#include <util/std_expr.h>

#include <sstream>

bddt bdd_exprt::from_expr_rec(const exprt &expr)
{
PRECONDITION(expr.type().id() == ID_bool);
Expand Down Expand Up @@ -112,7 +109,7 @@ exprt bdd_exprt::as_expr(
return true_exprt();
}

auto index = numeric_cast_v<std::size_t>(r.index());
auto index = narrow<std::size_t>(r.index());
INVARIANT(index < node_map.size(), "Index should be in node_map");
const exprt &n_expr = node_map[index];

Expand Down