28 is_template_parameter(
false),
106 typet &method_qualifier=
153 <<
"member '" <<
base_name <<
"' not found in scope '"
240 if(symbol.
type.
id()==
"cpp-template-type")
291 <<
"symbol '" << symbol.
display_name() <<
"': parameter "
292 << (i + 1) <<
" type mismatch\n"
330 <<
"' already declared with different type:\n"
419 symbol_table_baset::symbolst::const_iterator
c_it =
452 symbol.value=declarator.
value();
454 symbol.is_extern = storage_spec.
is_extern();
456 symbol.is_weak = storage_spec.
is_weak();
460 symbol.pretty_name=pretty_name;
465 symbol.is_static_lifetime =
false;
466 symbol.is_thread_local =
false;
468 symbol.is_file_local = storage_spec.
is_static();
473 if(symbol.value.is_nil())
484 is_number(symbol.type) && symbol.value.is_constant());
486 symbol.is_static_lifetime =
487 !symbol.is_macro && !symbol.is_type &&
488 (
cpp_typecheck.cpp_scopes.current_scope().is_global_scope() ||
491 symbol.is_thread_local =
492 (!symbol.is_static_lifetime && !storage_spec.
is_extern()) ||
495 symbol.is_file_local =
497 (!
cpp_typecheck.cpp_scopes.current_scope().is_global_scope() &&
499 (
cpp_typecheck.cpp_scopes.current_scope().is_global_scope() &&
504 if(symbol.is_static_lifetime)
505 cpp_typecheck.dynamic_initializations.push_back(symbol.name);
514 <<
"cpp_typecheckt::convert_declarator: symbol_table.move() failed"
530 if(!
id.is_class() && !
id.is_enum())
577 for(
auto it = parameters.begin(); it != parameters.end(); ++it)
581 if(it!=parameters.begin())
612 const typet &return_type=
620 throw "main must return int";
signedbv_typet signed_int_type()
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
void handle_initializer(symbolt &symbol, cpp_declaratort &declarator)
symbolt & convert_new_symbol(const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
bool is_code_type(const typet &type) const
irep_idt get_pretty_name()
void operator_overloading_rules(const symbolt &symbol)
cpp_declarator_convertert(class cpp_typecheckt &_cpp_typecheck)
void combine_types(const source_locationt &source_location, const typet &decl_type, symbolt &symbol)
irep_idt final_identifier
void main_function_rules(const symbolt &symbol)
symbolt & convert(const typet &type, const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
class cpp_typecheckt & cpp_typecheck
void get_final_identifier()
bool is_template_parameter
void enforce_rules(const symbolt &symbol)
irept & member_initializers()
typet merge_type(const typet &declaration_type) const
irept & method_qualifier()
bool get_is_parameter() const
const source_locationt & source_location() const
bool is_global_scope() const
id_sett lookup_identifier(const irep_idt &id, cpp_idt::id_classt identifier_class)
bool is_thread_local() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
bool get_bool(const irep_idt &name) 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
Structure type, corresponds to C style structs.
const basest & bases() const
Get the collection of base classes/structs.
const componentst & components() const
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
const irep_idt & display_name() const
Return language specific display name if present.
exprt value
Initial value of symbol.
const typet & subtype() const
The type of an expression, extends irept.
C++ Language Type Checking.
template_typet & to_template_type(typet &type)
std::string cpp_type2name(const typet &type)
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
C++ Language Type Checking.
C++ Language Type Checking.
const std::string & id2string(const irep_idt &d)
bool is_number(const typet &type)
Returns true if the type is a rational, real, integer, natural, complex, unsignedbv,...
bool is_reference(const typet &type)
Returns true if the type is a reference.
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define PRECONDITION(CONDITION)
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.