@@ -435,7 +435,7 @@ void cpp_typecheckt::default_assignop_value(
435
435
declarator.value ().add_source_location ()=source_location;
436
436
declarator.value ().id (ID_code);
437
437
declarator.value ().set (ID_statement, ID_block);
438
- declarator.value ().type ()= code_typet ();
438
+ declarator.value ().type () = code_typet ({}, empty_typet () );
439
439
440
440
exprt &block=declarator.value ();
441
441
@@ -482,13 +482,11 @@ void cpp_typecheckt::default_assignop_value(
482
482
continue ;
483
483
}
484
484
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 );
489
488
490
- exprt::operandst empty_operands;
491
- for (mp_integer i=0 ; i < size; ++i)
489
+ for (mp_integer i = 0 ; i < *size; ++i)
492
490
copy_array (source_location, mem_name, i, arg_name, block);
493
491
}
494
492
else
@@ -501,7 +499,7 @@ void cpp_typecheckt::default_assignop_value(
501
499
ret_code.operands ().push_back (exprt (ID_dereference));
502
500
ret_code.op0 ().operands ().push_back (exprt (" cpp-this" ));
503
501
ret_code.set (ID_statement, ID_return);
504
- ret_code.type ()= code_typet ();
502
+ ret_code.type () = code_typet ({}, empty_typet () );
505
503
}
506
504
507
505
// / Check a constructor initialization-list. An initializer has to be a data
0 commit comments