Skip to content

Commit 278e506

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2345 from tautschnig/c++-array-ini
C++ front-end: maintain #array_ini flag
2 parents f3a3e79 + ce4884e commit 278e506

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

regression/systemc/Array2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.cpp
33
-DNO_IO -DNO_STRING
44
^EXIT=0$

src/cpp/cpp_typecheck_code.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code)
177177

178178
// Let's first typecheck the operands.
179179
Forall_operands(it, code)
180+
{
181+
const bool has_array_ini = it->get_bool("#array_ini");
180182
typecheck_expr(*it);
183+
if(has_array_ini)
184+
it->set("#array_ini", true);
185+
}
181186

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

326-
Forall_operands(it, code)
327-
already_typechecked(*it);
328-
329331
exprt call=
330332
cpp_constructor(code.source_location(), symbol_expr, code.operands());
331333

0 commit comments

Comments
 (0)