Skip to content

Remove deprecated constructors #5180

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 3 commits into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion src/cpp/cpp_static_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ Author: Daniel Kroening, [email protected]
class cpp_static_assertt : public binary_exprt
{
public:
cpp_static_assertt() : binary_exprt(ID_cpp_static_assert)
cpp_static_assertt(exprt _cond, exprt _description)
: binary_exprt(
std::move(_cond),
ID_cpp_static_assert,
std::move(_description),
typet())
{
}

Expand Down
17 changes: 11 additions & 6 deletions src/cpp/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,19 +920,20 @@ bool Parser::rStaticAssert(cpp_static_assertt &cpp_static_assert)
if(lex.get_token(tk)!=TOK_STATIC_ASSERT)
return false;

cpp_static_assert=cpp_static_assertt();
set_location(cpp_static_assert, tk);

if(lex.get_token(tk)!='(')
return false;

if(!rExpression(cpp_static_assert.cond(), false))
exprt cond;

if(!rExpression(cond, false))
return false;

if(lex.get_token(tk)!=',')
return false;

if(!rExpression(cpp_static_assert.description(), false))
exprt description;

if(!rExpression(description, false))
return false;

if(lex.get_token(tk)!=')')
Expand All @@ -941,6 +942,10 @@ bool Parser::rStaticAssert(cpp_static_assertt &cpp_static_assert)
if(lex.get_token(tk)!=';')
return false;

cpp_static_assert =
cpp_static_assertt(std::move(cond), std::move(description));
set_location(cpp_static_assert, tk);

return true;
}

Expand Down Expand Up @@ -7505,7 +7510,7 @@ optionalt<codet> Parser::rStatement()

case TOK_STATIC_ASSERT:
{
cpp_static_assertt cpp_static_assert;
cpp_static_assertt cpp_static_assert{nil_exprt(), nil_exprt()};

if(!rStaticAssert(cpp_static_assert))
return {};
Expand Down
13 changes: 0 additions & 13 deletions src/util/byte_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ Author: Daniel Kroening, [email protected]
class byte_extract_exprt:public binary_exprt
{
public:
DEPRECATED(
SINCE(2019, 1, 12, "use byte_extract_exprt(id, op, offset, type) instead"))
explicit byte_extract_exprt(irep_idt _id):binary_exprt(_id)
{
}

DEPRECATED(
SINCE(2019, 1, 12, "use byte_extract_exprt(id, op, offset, type) instead"))
explicit byte_extract_exprt(irep_idt _id, const typet &_type):
binary_exprt(_id, _type)
{
}

byte_extract_exprt(
irep_idt _id,
const exprt &_op,
Expand Down
5 changes: 0 additions & 5 deletions src/util/mathematical_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ Author: Daniel Kroening, [email protected]
class transt : public ternary_exprt
{
public:
DEPRECATED(SINCE(2019, 1, 12, "use transt(op0, op1, op2) instead"))
transt() : ternary_exprt(ID_trans)
{
}

transt(
const irep_idt &_id,
const exprt &_op0,
Expand Down
36 changes: 0 additions & 36 deletions src/util/std_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,18 +748,6 @@ code_blockt create_fatal_assertion(
class code_ifthenelset:public codet
{
public:
DEPRECATED(SINCE(
2018,
12,
2,
"use code_ifthenelset(condition, then_code[, else_code]) instead"))
code_ifthenelset():codet(ID_ifthenelse)
{
operands().resize(3);
op1().make_nil();
op2().make_nil();
}

/// An if \p condition then \p then_code else \p else_code statement.
code_ifthenelset(exprt condition, codet then_code, codet else_code)
: codet(
Expand Down Expand Up @@ -1034,13 +1022,6 @@ inline code_dowhilet &to_code_dowhile(codet &code)
class code_fort:public codet
{
public:
DEPRECATED(
SINCE(2018, 12, 2, "use code_fort(init, cond, iter, body) instead"))
code_fort():codet(ID_for)
{
operands().resize(4);
}

/// A statement describing a for loop with initializer \p _init, loop
/// condition \p _cond, increment \p _iter, and body \p _body.
code_fort(exprt _init, exprt _cond, exprt _iter, codet _body)
Expand Down Expand Up @@ -1973,17 +1954,6 @@ inline const side_effect_exprt &to_side_effect_expr(const exprt &expr)
class side_effect_expr_nondett:public side_effect_exprt
{
public:
DEPRECATED(SINCE(
2018,
8,
9,
"use side_effect_expr_nondett(statement, type, loc) instead"))
explicit side_effect_expr_nondett(const typet &_type):
side_effect_exprt(ID_nondet, _type)
{
set_nullable(true);
}

side_effect_expr_nondett(typet _type, source_locationt loc)
: side_effect_exprt(ID_nondet, std::move(_type), std::move(loc))
{
Expand Down Expand Up @@ -2468,12 +2438,6 @@ static inline const code_landingpadt &to_code_landingpad(const codet &code)
class code_try_catcht:public codet
{
public:
DEPRECATED(SINCE(2018, 12, 2, "use code_try_catcht(try_code) instead"))
code_try_catcht():codet(ID_try_catch)
{
operands().resize(1);
}

/// A statement representing try \p _try_code catch ...
explicit code_try_catcht(codet _try_code)
: codet(ID_try_catch, {std::move(_try_code)})
Expand Down
Loading