Skip to content
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
13 changes: 13 additions & 0 deletions regression/systemc/Constructor1/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
struct S
{
S(int _x) : x(_x) {}
int x;
};

S s(42);

int main()
{
__CPROVER_assert(s.x == 42, "");
return 0;
}
9 changes: 9 additions & 0 deletions regression/systemc/Constructor1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.cpp

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
no body for function
9 changes: 7 additions & 2 deletions src/linking/static_lifetime_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ bool static_lifetime_init(
{
const symbolt &symbol=ns.lookup(id);

if(symbol.type.id()==ID_code &&
to_code_type(symbol.type).return_type().id()==ID_constructor)
if(symbol.type.id() != ID_code)
continue;

const code_typet &code_type = to_code_type(symbol.type);
if(
code_type.return_type().id() == ID_constructor &&
code_type.parameters().empty())
{
code_function_callt function_call;
function_call.function()=symbol.symbol_expr();
Expand Down