Skip to content

Commit

Permalink
C++ front-end: maintain #array_ini flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 12, 2018
1 parent 5b8897e commit ce4884e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion regression/systemc/Array2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.cpp
-DNO_IO -DNO_STRING
^EXIT=0$
Expand Down
8 changes: 5 additions & 3 deletions src/cpp/cpp_typecheck_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code)

// Let's first typecheck the operands.
Forall_operands(it, code)
{
const bool has_array_ini = it->get_bool("#array_ini");
typecheck_expr(*it);
if(has_array_ini)
it->set("#array_ini", true);
}

// The initializer may be a data member (non-type)
// or a parent class (type).
Expand Down Expand Up @@ -323,9 +328,6 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code)
// it's a data member
already_typechecked(symbol_expr);

Forall_operands(it, code)
already_typechecked(*it);

exprt call=
cpp_constructor(code.source_location(), symbol_expr, code.operands());

Expand Down

0 comments on commit ce4884e

Please sign in to comment.