@@ -437,7 +437,7 @@ void cpp_typecheckt::default_assignop_value(
437
437
declarator.value ().add_source_location ()=source_location;
438
438
declarator.value ().id (ID_code);
439
439
declarator.value ().set (ID_statement, ID_block);
440
- declarator.value ().type ()= code_typet ();
440
+ declarator.value ().type () = code_typet ({}, empty_typet () );
441
441
442
442
exprt &block=declarator.value ();
443
443
@@ -484,13 +484,11 @@ void cpp_typecheckt::default_assignop_value(
484
484
continue ;
485
485
}
486
486
487
- mp_integer size;
488
- bool to_int=to_integer (size_expr, size);
489
- CHECK_RETURN (!to_int);
490
- CHECK_RETURN (size>=0 );
487
+ const auto size = numeric_cast<mp_integer>(size_expr);
488
+ CHECK_RETURN (!size.has_value ());
489
+ CHECK_RETURN (*size >= 0 );
491
490
492
- exprt::operandst empty_operands;
493
- for (mp_integer i=0 ; i < size; ++i)
491
+ for (mp_integer i = 0 ; i < *size; ++i)
494
492
copy_array (source_location, mem_name, i, arg_name, block);
495
493
}
496
494
else
@@ -503,7 +501,7 @@ void cpp_typecheckt::default_assignop_value(
503
501
ret_code.operands ().push_back (exprt (ID_dereference));
504
502
ret_code.op0 ().operands ().push_back (exprt (" cpp-this" ));
505
503
ret_code.set (ID_statement, ID_return);
506
- ret_code.type ()= code_typet ();
504
+ ret_code.type () = code_typet ({}, empty_typet () );
507
505
}
508
506
509
507
// / Check a constructor initialization-list. An initializer has to be a data
0 commit comments