Merge pull request #2345 from tautschnig/c++-array-ini

C++ front-end: maintain #array_ini flag
This commit is contained in:
Daniel Kroening 2018-06-12 14:26:37 +01:00 committed by GitHub
commit 278e506e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.cpp
-DNO_IO -DNO_STRING
^EXIT=0$

View File

@ -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).
@ -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());