Skip to content

Avoid deprecated code_typet() constructor #2454

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 1 commit into from
Jun 25, 2018
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
4 changes: 2 additions & 2 deletions src/cpp/cpp_typecheck_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ void cpp_typecheckt::typecheck_code(codet &code)

if(statement==ID_try_catch)
{
code.type()=code_typet();
code.type() = code_typet({}, empty_typet());
typecheck_try_catch(code);
}
else if(statement==ID_member_initializer)
{
code.type()=code_typet();
code.type() = code_typet({}, empty_typet());
typecheck_member_initializer(code);
}
else if(statement==ID_msc_if_exists ||
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/cpp_typecheck_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void cpp_typecheckt::default_assignop_value(
declarator.value().add_source_location()=source_location;
declarator.value().id(ID_code);
declarator.value().set(ID_statement, ID_block);
declarator.value().type()=code_typet();
declarator.value().type() = code_typet({}, empty_typet());

exprt &block=declarator.value();

Expand Down Expand Up @@ -501,7 +501,7 @@ void cpp_typecheckt::default_assignop_value(
ret_code.operands().push_back(exprt(ID_dereference));
ret_code.op0().operands().push_back(exprt("cpp-this"));
ret_code.set(ID_statement, ID_return);
ret_code.type()=code_typet();
ret_code.type() = code_typet({}, empty_typet());
}

/// Check a constructor initialization-list. An initializer has to be a data
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5516,9 +5516,8 @@ bool Parser::rTypeNameOrFunctionType(typet &tname)
<< "Parser::rTypeNameOrFunctionType 2\n";
#endif

code_typet type;

if(!rCastOperatorName(type.return_type()))
typet return_type;
if(!rCastOperatorName(return_type))
return false;

#ifdef DEBUG
Expand All @@ -5528,7 +5527,7 @@ bool Parser::rTypeNameOrFunctionType(typet &tname)

if(lex.LookAhead(0)!='(')
{
tname.swap(type.return_type());
tname.swap(return_type);

if(!optPtrOperator(tname))
return false;
Expand All @@ -5541,6 +5540,7 @@ bool Parser::rTypeNameOrFunctionType(typet &tname)
<< "Parser::rTypeNameOrFunctionType 4\n";
#endif

code_typet type({}, return_type);
cpp_tokent op;
lex.get_token(op);

Expand Down
5 changes: 1 addition & 4 deletions src/goto-instrument/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ code_function_callt function_to_call(
typet p=pointer_type(char_type());
p.subtype().set(ID_C_constant, true);

code_typet function_type;
function_type.return_type()=empty_typet();
function_type.parameters().push_back(
code_typet::parametert(p));
const code_typet function_type({code_typet::parametert(p)}, empty_typet());

symbolt new_symbol;
new_symbol.name=id;
Expand Down