@@ -435,7 +435,7 @@ void cpp_typecheckt::default_assignop_value(
435435 declarator.value ().add_source_location ()=source_location;
436436 declarator.value ().id (ID_code);
437437 declarator.value ().set (ID_statement, ID_block);
438- declarator.value ().type ()= code_typet ();
438+ declarator.value ().type () = code_typet ({}, empty_typet () );
439439
440440 exprt &block=declarator.value ();
441441
@@ -482,13 +482,11 @@ void cpp_typecheckt::default_assignop_value(
482482 continue ;
483483 }
484484
485- mp_integer size;
486- bool to_int=to_integer (size_expr, size);
487- CHECK_RETURN (!to_int);
488- CHECK_RETURN (size>=0 );
485+ const auto size = numeric_cast<mp_integer>(size_expr);
486+ CHECK_RETURN (!size.has_value ());
487+ CHECK_RETURN (*size >= 0 );
489488
490- exprt::operandst empty_operands;
491- for (mp_integer i=0 ; i < size; ++i)
489+ for (mp_integer i = 0 ; i < *size; ++i)
492490 copy_array (source_location, mem_name, i, arg_name, block);
493491 }
494492 else
@@ -501,7 +499,7 @@ void cpp_typecheckt::default_assignop_value(
501499 ret_code.operands ().push_back (exprt (ID_dereference));
502500 ret_code.op0 ().operands ().push_back (exprt (" cpp-this" ));
503501 ret_code.set (ID_statement, ID_return);
504- ret_code.type ()= code_typet ();
502+ ret_code.type () = code_typet ({}, empty_typet () );
505503}
506504
507505// / Check a constructor initialization-list. An initializer has to be a data
0 commit comments