44 if(!operands.empty() && !operands.front().get_bool(
ID_C_array_ini))
47 error() <<
"bad array initializer" <<
eom;
52 operands.empty() || operands.size() == 1,
53 "array constructor must have at most one operand");
105 if(!operands.empty())
108 operand.add_source_location()=source_location;
117 return std::move(new_code);
148 error() <<
"initialization of POD requires one argument, "
149 "but got " << operands.size() <<
eom;
174 if(
component.get_base_name() !=
"@most_derived")
187 std::move(member), std::move(
val),
typet(), source_location);
204 for(
const auto &
c : components)
206 const typet &type =
c.type();
234 "initializer must be expression statement");
244 "expected new_object operand in address_of expression");
255 return std::move(block);
283 if(new_code.has_value())
285 if(new_code->get_statement() ==
ID_assign)
bitvector_typet c_index_type()
Operator to return the address of an object.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
static void make_already_typechecked(exprt &expr)
virtual void make_constant_index(exprt &expr)
A codet representing sequential composition of program statements.
code_operandst & statements()
void add(const codet &code)
codet representation of an expression statement.
cpp_scopet & set_scope(const irep_idt &identifier)
void typecheck_side_effect_assignment(side_effect_exprt &) override
void typecheck_side_effect_function_call(side_effect_expr_function_callt &) override
bool cpp_is_pod(const typet &type) const
void new_temporary(const source_locationt &source_location, const typet &, const exprt::operandst &ops, exprt &temporary)
std::optional< codet > cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
void elaborate_class_template(const typet &type)
elaborate class template instances
void add_implicit_dereference(exprt &)
void typecheck_expr(exprt &) override
std::string to_string(const typet &) override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
source_locationt & add_source_location()
The Boolean constant false.
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
Extract member of struct or union.
source_locationt source_location
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A side_effect_exprt that performs an assignment.
A side_effect_exprt representation of a function call side effect.
An expression containing a side effect.
Structure type, corresponds to C style structs.
std::vector< componentt > componentst
The Boolean constant true.
The type of an expression, extends irept.
C++ Language Type Checking.
API to expression classes for Pointers.
bool is_reference(const typet &type)
Returns true if the type is a reference.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
side_effect_expr_function_callt & to_side_effect_expr_function_call(exprt &expr)
code_expressiont & to_code_expression(codet &code)
const codet & to_code(const exprt &expr)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.