35 catch(
const char *
err)
42 catch(
const std::string &
err)
49 if(type.
id()==ID_cpp_name)
61 if(symbol_expr.
id()!=ID_type)
68 type=symbol_expr.
type();
75 irep_idt typedef_identifier = type.
get(ID_C_typedef);
87 qualifiers.
write(type);
89 else if(type.
id()==ID_struct ||
94 else if(type.
id()==ID_pointer)
108 typet &class_object =
static_cast<typet &
>(type.
add(ID_to_member));
110 if(class_object.
id()==ID_cpp_name)
113 class_object.
get_sub().back().id() ==
"::",
"scope suffix expected");
114 class_object.
get_sub().pop_back();
125 if(parameters.empty() || !parameters.front().get_this())
131 parameters.insert(parameters.begin(), a0);
139 qualifiers.
write(type);
141 else if(type.
id()==ID_array)
153 if(
to_array_type(type).element_type().get_bool(ID_C_constant))
154 type.
set(ID_C_constant,
true);
156 if(
to_array_type(type).element_type().get_bool(ID_C_volatile))
157 type.
set(ID_C_volatile,
true);
159 else if(type.
id()==ID_vector)
163 else if(type.
id() == ID_frontend_vector)
167 else if(type.
id()==ID_code)
174 for(
auto ¶m : parameters)
179 if(param.has_default_value())
186 else if(type.
id()==ID_template)
190 else if(type.
id()==ID_c_enum)
194 else if(type.
id()==ID_c_enum_tag)
197 else if(type.
id()==ID_c_bit_field)
202 type.
id() == ID_unsignedbv || type.
id() == ID_signedbv ||
203 type.
id() == ID_bool || type.
id() == ID_c_bool || type.
id() == ID_floatbv ||
204 type.
id() == ID_fixedbv || type.
id() == ID_empty)
207 else if(type.
id() == ID_struct_tag)
210 else if(type.
id() == ID_union_tag)
213 else if(type.
id()==ID_constructor ||
214 type.
id()==ID_destructor)
217 else if(type.
id()==
"cpp-cast-operator")
220 else if(type.
id()==
"cpp-template-type")
223 else if(type.
id()==ID_typeof)
230 static_cast<const typet &
>(type.
find(ID_type_arg));
232 if(tmp_type.
id()==ID_cpp_name)
244 type=symbol_expr.
type();
258 else if(type.
id()==ID_decltype)
263 if(e.
type().
id() == ID_c_bit_field)
268 else if(type.
id()==ID_unassigned)
272 else if(type.
id()==ID_template_class_instance)
276 else if(type.
id()==ID_block_pointer)
281 type.
id(ID_frontend_pointer);
284 else if(type.
id()==ID_nullptr)
287 else if(type.
id()==ID_already_typechecked)
291 else if(type.
id() == ID_gcc_attribute_mode)
298 type.
swap(as_parsed);
302 else if(type.
id() == ID_complex)
pointer_typet pointer_type(const typet &subtype)
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a typet to a c_bit_field_typet.
const exprt & size() const
const typet & underlying_type() const
virtual void write(typet &src) const
virtual void typecheck_vector_type(typet &type)
virtual void typecheck_c_bit_field_type(c_bit_field_typet &type)
virtual void typecheck_type(typet &type)
void set_base_name(const irep_idt &name)
std::vector< parametert > parameterst
const typet & return_type() const
const parameterst & parameters() const
void typecheck_type(typet &) override
void typecheck_enum_type(typet &type)
void implicit_typecast(exprt &expr, const typet &type) override
void typecheck_compound_type(struct_union_typet &) override
void typecheck_expr(exprt &) override
exprt resolve(const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
Unbounded, signed integers (mathematical integers, not bitvectors)
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool get_bool(const irep_idt &name) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irept & find(const irep_idt &name) const
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)
holds a combination of types
source_locationt source_location
message_handlert & get_message_handler()
Unbounded, signed rational numbers.
void move_to_subtypes(typet &type)
Move the provided type to the subtypes of this type.
The type of an expression, extends irept.
const source_locationt & source_location() const
source_locationt & add_source_location()
void cpp_convert_plain_type(typet &type, message_handlert &message_handler)
cpp_namet & to_cpp_name(irept &cpp_name)
template_typet & to_template_type(typet &type)
C++ Language Type Checking.
C++ Language Type Checking.
void err(int eval, const char *fmt,...)
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
bool simplify(exprt &expr, const namespacet &ns)
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const type_with_subtypet & to_type_with_subtype(const typet &type)