cprover
|
#include <cpp_typecheck.h>
Classes | |
class | instantiation_levelt |
class | instantiationt |
struct | method_bodyt |
Public Member Functions | |
cpp_typecheckt (cpp_parse_treet &_cpp_parse_tree, symbol_tablet &_symbol_table, const std::string &_module, message_handlert &message_handler) | |
cpp_typecheckt (cpp_parse_treet &_cpp_parse_tree, symbol_tablet &_symbol_table1, const symbol_tablet &_symbol_table2, const std::string &_module, message_handlert &message_handler) | |
virtual | ~cpp_typecheckt () |
virtual void | typecheck () |
typechecking main method More... | |
virtual std::string | to_string (const typet &type) |
virtual std::string | to_string (const exprt &expr) |
exprt | resolve (const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true) |
virtual void | typecheck_expr (exprt &expr) |
bool | cpp_is_pod (const typet &type) const |
codet | cpp_constructor (const source_locationt &source_location, const exprt &object, const exprt::operandst &operands) |
bool | standard_conversion_lvalue_to_rvalue (const exprt &expr, exprt &new_expr) const |
Lvalue-to-rvalue conversion. More... | |
bool | standard_conversion_array_to_pointer (const exprt &expr, exprt &new_expr) const |
Array-to-pointer conversion. More... | |
bool | standard_conversion_function_to_pointer (const exprt &expr, exprt &new_expr) const |
Function-to-pointer conversion. More... | |
bool | standard_conversion_qualification (const exprt &expr, const typet &, exprt &new_expr) const |
Qualification conversion. More... | |
bool | standard_conversion_integral_promotion (const exprt &expr, exprt &new_expr) const |
Integral-promotion conversion. More... | |
bool | standard_conversion_floating_point_promotion (const exprt &expr, exprt &new_expr) const |
Floating-point-promotion conversion. More... | |
bool | standard_conversion_integral_conversion (const exprt &expr, const typet &type, exprt &new_expr) const |
Integral conversion. More... | |
bool | standard_conversion_floating_integral_conversion (const exprt &expr, const typet &type, exprt &new_expr) const |
Floating-integral conversion. More... | |
bool | standard_conversion_floating_point_conversion (const exprt &expr, const typet &type, exprt &new_expr) const |
Floating-point conversion. More... | |
bool | standard_conversion_pointer (const exprt &expr, const typet &type, exprt &new_expr) |
Pointer conversion. More... | |
bool | standard_conversion_pointer_to_member (const exprt &expr, const typet &type, exprt &new_expr) |
Pointer-to-member conversion. More... | |
bool | standard_conversion_boolean (const exprt &expr, exprt &new_expr) const |
Boolean conversion. More... | |
bool | standard_conversion_sequence (const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank) |
Standard Conversion Sequence. More... | |
bool | user_defined_conversion_sequence (const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank) |
User-defined conversion sequence. More... | |
bool | reference_related (const exprt &expr, const typet &type) const |
Reference-related. More... | |
bool | reference_compatible (const exprt &expr, const typet &type, unsigned &rank) const |
Reference-compatible. More... | |
bool | reference_binding (exprt expr, const typet &type, exprt &new_expr, unsigned &rank) |
Reference binding. More... | |
bool | implicit_conversion_sequence (const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank) |
implicit conversion sequence More... | |
bool | implicit_conversion_sequence (const exprt &expr, const typet &type, unsigned &rank) |
implicit conversion sequence More... | |
bool | implicit_conversion_sequence (const exprt &expr, const typet &type, exprt &new_expr) |
implicit conversion sequence More... | |
void | reference_initializer (exprt &expr, const typet &type) |
A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows: More... | |
virtual void | implicit_typecast (exprt &expr, const typet &type) |
void | get_bases (const struct_typet &type, std::set< irep_idt > &set_bases) const |
void | get_virtual_bases (const struct_typet &type, std::list< irep_idt > &vbases) const |
bool | subtype_typecast (const struct_typet &from, const struct_typet &to) const |
void | make_ptr_typecast (exprt &expr, const typet &dest_type) |
bool | const_typecast (const exprt &expr, const typet &type, exprt &new_expr) |
bool | dynamic_typecast (const exprt &expr, const typet &type, exprt &new_expr) |
bool | reinterpret_typecast (const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true) |
bool | static_typecast (const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true) |
![]() | |
c_typecheck_baset (symbol_tablet &_symbol_table, const std::string &_module, message_handlert &_message_handler) | |
c_typecheck_baset (symbol_tablet &_symbol_table1, const symbol_tablet &_symbol_table2, const std::string &_module, message_handlert &_message_handler) | |
virtual | ~c_typecheck_baset () |
![]() | |
typecheckt (message_handlert &_message_handler) | |
virtual | ~typecheckt () |
void | err_location (const source_locationt &loc) |
void | err_location (const exprt &src) |
void | err_location (const typet &src) |
virtual bool | typecheck_main () |
![]() | |
namespacet (const symbol_tablet &_symbol_table) | |
namespacet (const symbol_tablet &_symbol_table1, const symbol_tablet &_symbol_table2) | |
namespacet (const symbol_tablet *_symbol_table1, const symbol_tablet *_symbol_table2) | |
virtual bool | lookup (const irep_idt &name, const symbolt *&symbol) const |
virtual unsigned | get_max (const std::string &prefix) const |
const symbol_tablet & | get_symbol_table () const |
![]() | |
const symbolt & | lookup (const irep_idt &name) const |
const symbolt & | lookup (const irept &irep) const |
virtual | ~namespace_baset () |
void | follow_symbol (irept &irep) const |
void | follow_macros (exprt &expr) const |
const typet & | follow (const typet &src) const |
const typet & | follow_tag (const union_tag_typet &src) const |
const typet & | follow_tag (const struct_tag_typet &src) const |
const typet & | follow_tag (const c_enum_tag_typet &src) const |
Protected Types | |
typedef std::list< instantiationt > | instantiation_stackt |
typedef std::list< method_bodyt > | method_bodiest |
![]() | |
typedef std::unordered_map< irep_idt, typet, irep_id_hash > | id_type_mapt |
typedef std::unordered_map< irep_idt, irep_idt, irep_id_hash > | asm_label_mapt |
Static Protected Member Functions | |
static bool | has_const (const typet &type) |
static bool | has_volatile (const typet &type) |
![]() | |
static void | add_rounding_mode (exprt &) |
static bool | is_numeric_type (const typet &src) |
Protected Attributes | |
cpp_scopest | cpp_scopes |
cpp_parse_treet & | cpp_parse_tree |
irep_idt | current_linkage_spec |
instantiation_stackt | instantiation_stack |
unsigned | template_counter |
unsigned | anon_counter |
template_mapt | template_map |
method_bodiest | method_bodies |
![]() | |
symbol_tablet & | symbol_table |
const irep_idt | module |
const irep_idt | mode |
symbolt | current_symbol |
id_type_mapt | parameter_map |
bool | break_is_allowed |
bool | continue_is_allowed |
bool | case_is_allowed |
typet | switch_op_type |
typet | return_type |
std::map< irep_idt, source_locationt > | labels_defined |
std::map< irep_idt, source_locationt > | labels_used |
std::list< codet > | clean_code |
asm_label_mapt | asm_label_map |
![]() | |
const symbol_tablet * | symbol_table1 |
const symbol_tablet * | symbol_table2 |
Private Types | |
typedef std::list< irep_idt > | dynamic_initializationst |
Private Attributes | |
dynamic_initializationst | dynamic_initializations |
bool | disable_access_control |
Friends | |
class | cpp_typecheck_resolvet |
class | cpp_declarator_convertert |
Additional Inherited Members |
Definition at line 44 of file cpp_typecheck.h.
|
private |
Definition at line 594 of file cpp_typecheck.h.
|
protected |
Definition at line 182 of file cpp_typecheck.h.
|
protected |
Definition at line 340 of file cpp_typecheck.h.
|
inline |
Definition at line 47 of file cpp_typecheck.h.
|
inline |
Definition at line 60 of file cpp_typecheck.h.
|
inlinevirtual |
Definition at line 75 of file cpp_typecheck.h.
References to_string(), and typecheck().
|
protected |
Definition at line 1360 of file cpp_typecheck_compound_type.cpp.
References symbolt::base_name, struct_union_typet::components(), cpp_scopet::contains(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), cpp_idt::id_class, cpp_scopet::insert(), namespacet::lookup(), symbolt::name, typet::source_location(), messaget::mstreamt::source_location, cpp_idt::SYMBOL, to_struct_union_type(), and symbolt::type.
Referenced by convert_anon_struct_union_member(), and typecheck_compound_body().
|
protected |
Definition at line 120 of file cpp_typecheck_bases.cpp.
References struct_union_typet::components(), messaget::eom(), messaget::error(), irept::find(), forall_irep, irept::get(), struct_union_typet::componentt::get_access(), irept::get_sub(), namespacet::lookup(), irept::set(), struct_union_typet::componentt::set_access(), typet::source_location(), messaget::mstreamt::source_location, to_struct_type(), and symbolt::type.
Referenced by typecheck_compound_bases().
|
protected |
Definition at line 1900 of file cpp_typecheck_expr.cpp.
References is_reference(), irept::set(), exprt::source_location(), typet::subtype(), irept::swap(), and exprt::type().
Referenced by const_typecast(), cpp_constructor(), dynamic_typecast(), implicit_conversion_sequence(), operator_is_overloaded(), reference_binding(), reference_initializer(), reinterpret_typecast(), static_typecast(), typecheck_cast_expr(), typecheck_compound_body(), typecheck_expr_binary_arithmetic(), typecheck_expr_cpp_name(), typecheck_expr_explicit_typecast(), typecheck_expr_member(), typecheck_expr_ptrmember(), typecheck_function_expr(), typecheck_side_effect_function_call(), and typecheck_side_effect_inc_dec().
|
inlineprotected |
Definition at line 343 of file cpp_typecheck.h.
References check_fixed_size_array(), put_compound_into_scope(), tag_scope(), typecheck_compound_body(), typecheck_compound_declarator(), typecheck_compound_type(), typecheck_enum_type(), typecheck_friend_declaration(), typecheck_template_parameters(), and typecheck_type().
Referenced by cpp_declarator_convertert::convert_new_symbol(), cpp_declarator_convertert::handle_initializer(), typecheck_member_function(), typecheck_method_application(), and typecheck_side_effect_function_call().
|
protected |
Definition at line 1333 of file cpp_typecheck_compound_type.cpp.
References has_const(), has_volatile(), code_typet::parameters(), pointer_type(), irept::set(), code_typet::parametert::set_base_name(), code_typet::parametert::set_identifier(), code_typet::parametert::set_this(), to_code_type(), and exprt::type().
Referenced by cpp_declarator_convertert::convert(), typecheck_compound_body(), and typecheck_member_function().
Definition at line 1599 of file cpp_typecheck_conversions.cpp.
References irept::id(), is_reference(), c_qualifierst::read(), irept::remove(), standard_conversion_qualification(), and c_qualifierst::write().
Referenced by dynamic_typecast(), reinterpret_typecast(), and static_typecast().
|
protected |
Definition at line 1560 of file cpp_typecheck_compound_type.cpp.
References cpp_scopes, cpp_scopest::current_scope(), irept::find(), forall_irep, irept::get(), cpp_scopet::get_parent(), cpp_scopest::get_scope(), irept::get_sub(), cpp_idt::identifier, cpp_idt::is_class(), cpp_scopet::is_root_scope(), namespacet::lookup(), subtype_typecast(), and to_struct_type().
Referenced by get_component().
|
protected |
check that an array has fixed size
Definition at line 753 of file cpp_typecheck_compound_type.cpp.
References irept::id(), irept::is_not_nil(), c_typecheck_baset::make_constant_index(), array_typet::size(), typet::subtype(), and to_array_type().
Referenced by add_method_body(), cpp_declarator_convertert::convert(), and typecheck_compound_declarator().
|
protected |
Check a constructor initialization-list.
An initializer has to be a data member declared in this class or a direct-parent constructor.
bases | the parents of the class |
components | the components of the class |
initializers | the constructor initializers |
Definition at line 519 of file cpp_typecheck_constructor.cpp.
References messaget::eom(), messaget::error(), irept::find(), forall_irep, irept::get(), irept::get_sub(), cpp_namet::has_template_args(), irept::id(), irept::is_not_nil(), namespacet::lookup(), symbolt::name, messaget::mstreamt::source_location, to_cpp_name(), symbolt::type, and typecheck_type().
Referenced by cpp_declarator_convertert::convert(), and typecheck_compound_body().
|
protected |
Definition at line 423 of file cpp_typecheck_template.cpp.
References cpp_template_args_baset::arguments(), cpp_expr2name(), cpp_scopes, cpp_type2name(), cpp_scopest::current_scope(), id2string(), cpp_idt::prefix, and template_typet::template_parameters().
Referenced by function_template_identifier(), and typecheck_class_template().
|
protected |
Definition at line 109 of file cpp_instantiate_template.cpp.
References cpp_template_args_baset::arguments(), symbolt::base_name, cpp_idt::CLASS, cpp_scopes, messaget::eom(), messaget::error(), irept::find(), irept::get_bool(), cpp_template_args_tct::has_unassigned(), id2string(), cpp_idt::id_class, cpp_scopest::id_map, INVARIANT_STRUCTURED, symbolt::location, symbolt::mode, symbol_tablet::move(), symbolt::name, cpp_idt::prefix, symbolt::pretty_name, cpp_scopest::put_into_scope(), irept::set(), messaget::mstreamt::source_location, c_typecheck_baset::symbol_table, symbol_tablet::symbols, template_suffix(), and symbolt::type.
Referenced by cpp_typecheck_resolvet::disambiguate_template_classes().
|
protected |
Definition at line 267 of file cpp_typecheck.cpp.
References irept::add(), struct_union_typet::components(), irept::get_bool(), irept::get_sub(), irept::id(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, to_struct_union_type(), and symbolt::type.
Referenced by typecheck().
Definition at line 1662 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), irept::get_bool(), irept::id(), is_reference(), standard_conversion_array_to_pointer(), standard_conversion_function_to_pointer(), standard_conversion_lvalue_to_rvalue(), typet::subtype(), irept::swap(), to_pointer_type(), and exprt::type().
Referenced by typecheck_cast_expr(), typecheck_compound_body(), and typecheck_expr_explicit_typecast().
|
protected |
Definition at line 14 of file cpp_typecheck_linkage_spec.cpp.
References current_linkage_spec, irept::get(), cpp_linkage_spect::items(), and cpp_linkage_spect::linkage().
Referenced by convert(), instantiate_template(), typecheck(), and typecheck_class_template_member().
|
protected |
Definition at line 16 of file cpp_typecheck_namespace.cpp.
References cpp_scopet::add_using_scope(), cpp_namespace_spect::alias(), symbolt::base_name, convert(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), cpp_namespace_spect::get_namespace(), id2string(), irept::is_not_nil(), cpp_namespace_spect::items(), symbolt::location, irept::make_nil(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_scopest::new_namespace(), cpp_idt::prefix, cpp_typecheck_resolvet::resolve_namespace(), cpp_scopest::set_scope(), exprt::source_location(), messaget::mstreamt::source_location, c_typecheck_baset::symbol_table, symbol_tablet::symbols, symbolt::type, and symbolt::value.
|
protected |
Definition at line 16 of file cpp_typecheck_using.cpp.
References cpp_scopet::add_using_scope(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), cpp_usingt::get_namespace(), id_set, cpp_scopet::insert(), cpp_namet::is_qualified(), cpp_scopet::lookup(), cpp_usingt::name(), cpp_idt::NAMESPACE, cpp_scopet::QUALIFIED, cpp_scopet::RECURSIVE, cpp_typecheck_resolvet::resolve_scope(), cpp_save_scopet::restore(), cpp_namet::source_location(), messaget::mstreamt::source_location, and cpp_idt::TEMPLATE_PARAMETER.
|
protected |
Definition at line 27 of file cpp_typecheck.cpp.
References convert(), messaget::eom(), messaget::error(), cpp_itemt::get_linkage_spec(), cpp_itemt::get_namespace_spec(), cpp_itemt::get_static_assert(), cpp_itemt::get_using(), irept::id(), cpp_itemt::is_declaration(), cpp_itemt::is_linkage_spec(), cpp_itemt::is_namespace_spec(), cpp_itemt::is_static_assert(), cpp_itemt::is_using(), cpp_itemt::source_location(), messaget::mstreamt::source_location, and to_cpp_declaration().
|
protected |
Definition at line 16 of file cpp_typecheck_declaration.cpp.
References convert_non_template_declaration(), convert_template_declaration(), cpp_declarationt::is_empty(), cpp_declarationt::is_template(), method_bodies, and typecheck_method_bodies().
|
protected |
|
protected |
Definition at line 16 of file cpp_typecheck_static_assert.cpp.
References messaget::eom(), messaget::error(), irept::get(), irept::id(), exprt::is_false(), exprt::is_true(), c_typecheck_baset::make_constant(), exprt::make_typecast(), exprt::op0(), exprt::op1(), exprt::source_location(), messaget::mstreamt::source_location, and typecheck_expr().
|
protected |
Definition at line 1410 of file cpp_typecheck_compound_type.cpp.
References add_anonymous_members_to_scope(), exprt::add_source_location(), dstringt::c_str(), cpp_is_pod(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), namespace_baset::follow(), cpp_storage_spect::is_mutable(), cpp_storage_spect::is_static(), symbolt::name, cpp_idt::prefix, put_compound_into_scope(), irept::set(), struct_union_typet::componentt::set_access(), struct_union_typet::componentt::set_anonymous(), struct_union_typet::componentt::set_base_name(), struct_union_typet::componentt::set_pretty_name(), typet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, cpp_declarationt::storage_spec(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, symbolt::type, and exprt::type().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 39 of file cpp_typecheck_declaration.cpp.
References irept::add(), anon_counter, symbolt::base_name, cpp_scopet::contains(), cpp_declarator_convertert::convert(), exprt::copy_to_operands(), cpp_is_pod(), cpp_scopes, cpp_symbol_expr(), cpp_scopest::current_scope(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), namespace_baset::follow(), forall_irep, irept::get(), irept::get_sub(), cpp_idt::id_class, cpp_scopet::insert(), exprt::move_to_operands(), irept::move_to_sub(), cpp_declaratort::name(), symbolt::name, exprt::reserve_operands(), irept::set(), typet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), cpp_idt::SYMBOL, c_typecheck_baset::symbol_table, symbol_tablet::symbols, symbolt::type, and exprt::type().
Referenced by convert_non_template_declaration(), and typecheck_decl().
|
protected |
Definition at line 499 of file cpp_typecheck_template.cpp.
References irept::add(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), irept::get_sub(), irept::id(), id_set, instantiate_template(), cpp_scopet::lookup(), namespacet::lookup(), cpp_declarationt::partial_specialization_args(), cpp_scopet::SCOPE_ONLY, cpp_declarationt::set_specialization_of(), typet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, c_typecheck_baset::symbol_table, symbol_tablet::symbols, cpp_idt::TEMPLATE, cpp_declarationt::template_type(), to_cpp_declaration(), to_cpp_template_args_non_tc(), exprt::type(), typecheck_class_template(), and typecheck_template_args().
Referenced by convert_template_declaration().
|
protected |
Definition at line 78 of file cpp_typecheck_function.cpp.
References convert_parameters(), exprt::copy_to_operands(), cpp_scopes, dtor(), irept::get(), irept::id(), id2string(), cpp_idt::is_method, irept::is_nil(), cpp_idt::is_static_member, namespacet::lookup(), irept::make_nil(), symbolt::mode, symbolt::name, code_typet::parameters(), cpp_idt::prefix, c_typecheck_baset::return_type, code_typet::return_type(), irept::set(), cpp_scopest::set_scope(), c_typecheck_baset::start_typecheck_code(), template_subtype(), cpp_idt::this_expr, to_code(), to_code_type(), symbolt::type, exprt::type(), typecheck_code(), and symbolt::value.
Referenced by do_not_typechecked(), and typecheck_method_bodies().
|
protected |
Initialize an object with a value.
Definition at line 24 of file cpp_typecheck_initializer.cpp.
References irept::add(), already_typechecked(), symbolt::base_name, cpp_typecheck_resolvet::BOTH, cpp_constructor(), cpp_is_pod(), c_typecheck_baset::do_initializer(), messaget::eom(), messaget::error(), irept::find(), irept::get(), cpp_typecheck_fargst::has_object, irept::id(), implicit_typecast(), cpp_typecheck_fargst::in_use, irept::is_nil(), is_reference(), symbolt::is_type, symbolt::location, namespacet::lookup(), symbolt::name, exprt::op0(), cpp_typecheck_fargst::operands, code_typet::parameters(), reference_initializer(), resolve(), irept::set(), simplify_exprt::simplify(), simplify(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), to_code_type(), to_cpp_name(), to_string(), symbolt::type, exprt::type(), typecheck_expr(), typecheck_type(), and symbolt::value.
Referenced by cpp_declarator_convertert::convert_new_symbol(), and cpp_declarator_convertert::handle_initializer().
|
protected |
Definition at line 113 of file cpp_typecheck_declaration.cpp.
References cpp_declarator_convertert::convert(), convert_anonymous_union(), cpp_constructor(), cpp_symbol_expr(), cpp_declarationt::declarators(), elaborate_class_template(), messaget::eom(), messaget::error(), irept::find(), namespace_baset::follow(), exprt::has_operands(), irept::id(), cpp_declaratort::init_args(), symbolt::is_lvalue, irept::is_not_nil(), cpp_declarationt::is_template(), cpp_declarator_convertert::is_typedef, cpp_declarationt::is_typedef(), symbolt::location, cpp_declarationt::member_spec(), cpp_declarationt::name_anon_struct_union(), exprt::operands(), irept::set(), typet::source_location(), messaget::mstreamt::source_location, cpp_declarationt::storage_spec(), symbolt::type, exprt::type(), typecheck_type(), and symbolt::value.
Referenced by convert(), convert_template_function_or_member_specialization(), and instantiate_template().
|
protected |
Definition at line 20 of file cpp_typecheck_function.cpp.
References anon_counter, symbolt::base_name, cpp_scopes, cpp_scopest::current_scope(), dstringt::empty(), messaget::eom(), messaget::error(), code_typet::parametert::get_base_name(), id2string(), symbolt::is_lvalue, is_reference(), symbolt::is_state_var, symbolt::location, symbolt::mode, c_typecheck_baset::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_idt::prefix, cpp_scopest::put_into_scope(), code_typet::parametert::set_base_name(), code_typet::parametert::set_identifier(), exprt::source_location(), messaget::mstreamt::source_location, c_typecheck_baset::symbol_table, symbolt::type, and exprt::type().
Referenced by convert_parameters().
|
protected |
Definition at line 64 of file cpp_typecheck_function.cpp.
References convert_parameter(), and code_typet::parameters().
Referenced by convert_function().
|
protected |
Definition at line 2612 of file cpp_typecheck_expr.cpp.
References messaget::eom(), messaget::error(), irept::find(), exprt::find_source_location(), namespace_baset::follow(), irept::get_bool(), irept::id(), irept::is_nil(), exprt::op0(), exprt::op1(), exprt::operands(), irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), subtype_typecast(), irept::swap(), to_struct_type(), exprt::type(), and typecheck_expr_main().
Referenced by typecheck_expr_main().
|
protected |
Definition at line 995 of file cpp_typecheck_template.cpp.
References convert_class_template_specialization(), convert_template_function_or_member_specialization(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), irept::find(), cpp_namet::has_template_args(), irept::id(), cpp_declarationt::is_class_template(), cpp_namet::is_qualified(), cpp_declarationt::is_template(), cpp_declarationt::is_typedef(), cpp_member_spect::is_virtual(), cpp_declarationt::member_spec(), exprt::source_location(), messaget::mstreamt::source_location, template_typet::template_parameters(), cpp_declarationt::template_type(), to_cpp_name(), exprt::type(), typecheck_class_template(), typecheck_class_template_member(), and typecheck_function_template().
Referenced by convert(), and typecheck_compound_body().
|
protected |
Definition at line 620 of file cpp_typecheck_template.cpp.
References convert_non_template_declaration(), cpp_scopes, cpp_scopest::current_scope(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), irept::get_sub(), id_set, instantiate_template(), cpp_namet::is_qualified(), cpp_scopet::lookup(), namespacet::lookup(), irept::remove(), cpp_scopet::SCOPE_ONLY, irept::set(), cpp_namet::source_location(), typet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), to_cpp_template_args_non_tc(), exprt::type(), and typecheck_template_args().
Referenced by convert_template_declaration().
codet cpp_typecheckt::cpp_constructor | ( | const source_locationt & | source_location, |
const exprt & | object, | ||
const exprt::operandst & | operands | ||
) |
object | non-typechecked object |
operands | non-typechecked operands |
Definition at line 24 of file cpp_constructor.cpp.
References irept::add(), add_implicit_dereference(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), struct_union_typet::components(), exprt::copy_to_operands(), cpp_is_pod(), cpp_scopes, elaborate_class_template(), messaget::eom(), messaget::error(), code_expressiont::expression(), irept::find(), namespace_baset::follow_symbol(), from_integer(), side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), irept::get_sub(), irept::id(), index_type(), irept::is_nil(), is_reference(), c_typecheck_baset::make_constant_index(), irept::make_nil(), exprt::move_to_operands(), exprt::op1(), exprt::operands(), irept::set(), cpp_scopest::set_scope(), array_typet::size(), messaget::mstreamt::source_location, irept::swap(), to_array_type(), to_code(), to_integer(), to_side_effect_expr_function_call(), to_string(), to_struct_type(), exprt::type(), typecheck_expr(), typecheck_side_effect_assignment(), and typecheck_side_effect_function_call().
Referenced by convert_initializer(), convert_non_template_declaration(), new_temporary(), resolve(), static_and_dynamic_initialization(), typecheck_compound_declarator(), typecheck_decl(), typecheck_expr_new(), and typecheck_member_initializer().
|
protected |
Definition at line 19 of file cpp_destructor.cpp.
References irept::add(), exprt::add_source_location(), struct_union_typet::components(), exprt::copy_to_operands(), cpp_is_pod(), cpp_scopes, elaborate_class_template(), messaget::eom(), messaget::error(), irept::find(), namespace_baset::follow_symbol(), from_integer(), side_effect_expr_function_callt::function(), irept::get(), irept::get_sub(), irept::id(), index_type(), is_reference(), c_typecheck_baset::make_constant_index(), irept::make_nil(), exprt::move_to_operands(), pointer_type(), cpp_scopest::set_scope(), codet::set_statement(), array_typet::size(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), to_array_type(), to_integer(), to_side_effect_expr_function_call(), to_string(), to_struct_type(), exprt::type(), and typecheck_side_effect_function_call().
Referenced by dtor(), typecheck_compound_body(), and typecheck_expr_delete().
bool cpp_typecheckt::cpp_is_pod | ( | const typet & | type | ) | const |
Definition at line 14 of file cpp_is_pod.cpp.
References struct_union_typet::components(), irept::find(), irept::get(), irept::get_sub(), irept::id(), is_reference(), symbolt::is_type, namespacet::lookup(), c_typecheck_baset::return_type, code_typet::return_type(), typet::subtype(), to_code_type(), to_struct_type(), and symbolt::type.
Referenced by convert_anon_struct_union_member(), convert_anonymous_union(), convert_initializer(), cpp_constructor(), cpp_destructor(), default_cpctor(), dtor(), full_member_initialization(), cpp_typecheck_resolvet::make_constructors(), cpp_typecheck_resolvet::resolve(), resolve(), static_and_dynamic_initialization(), static_typecast(), typecheck_compound_body(), typecheck_compound_declarator(), typecheck_expr_explicit_constructor_call(), typecheck_side_effect_assignment(), typecheck_side_effect_function_call(), user_defined_conversion_sequence(), and zero_initializer().
|
protected |
Generate declaration of the implicit default assignment operator.
Definition at line 358 of file cpp_typecheck_constructor.cpp.
References irept::add(), typet::add_source_location(), exprt::add_source_location(), symbolt::base_name, irept::get_sub(), irept::id(), id2string(), irept::make_nil(), cpp_declaratort::name(), symbolt::name, exprt::op0(), exprt::operands(), irept::set(), source_locationt::set_function(), typet::source_location(), typet::subtype(), typet::subtypes(), symbolt::type, exprt::type(), and cpp_declaratort::value().
Referenced by typecheck_compound_body().
|
protected |
Generate code for the implicit default assignment operator.
Definition at line 432 of file cpp_typecheck_constructor.cpp.
References exprt::add_source_location(), copy_array(), copy_member(), copy_parent(), irept::find(), forall_irep, irept::get_sub(), irept::id(), namespacet::lookup(), irept::make_nil(), exprt::op0(), exprt::operands(), irept::set(), exprt::source_location(), to_array_type(), to_integer(), symbolt::type, exprt::type(), and cpp_declaratort::value().
Referenced by do_not_typechecked().
|
protected |
Generate code for implicit default copy constructor.
Definition at line 189 of file cpp_typecheck_constructor.cpp.
References irept::add(), exprt::add_source_location(), already_typechecked(), symbolt::base_name, struct_union_typet::components(), copy_parent(), exprt::copy_to_operands(), cpp_is_pod(), cpp_declarationt::declarators(), default_ctor(), irept::find(), forall_irep, irept::get_sub(), irept::id(), id2string(), namespacet::lookup(), irept::make_nil(), exprt::move_to_operands(), irept::move_to_sub(), symbolt::name, namespacet::namespacet(), exprt::op0(), exprt::operands(), irept::set(), source_locationt::set_function(), typet::source_location(), typet::subtype(), typet::subtypes(), symbolt::symbol_expr(), c_typecheck_baset::symbol_table, to_struct_type(), symbolt::type, exprt::type(), and cpp_declaratort::value().
Referenced by typecheck_compound_body().
|
protected |
Generate code for implicit default constructors.
Definition at line 160 of file cpp_typecheck_constructor.cpp.
References irept::add(), exprt::add_source_location(), irept::id(), irept::make_nil(), exprt::move_to_operands(), irept::move_to_sub(), cpp_declaratort::name(), irept::set(), typet::subtype(), exprt::type(), and cpp_declaratort::value().
Referenced by default_cpctor(), and typecheck_compound_body().
|
protected |
Note:
Definition at line 29 of file cpp_typecheck_destructor.cpp.
References irept::add(), symbolt::base_name, irept::id(), id2string(), symbolt::location, irept::make_nil(), exprt::move_to_operands(), irept::move_to_sub(), cpp_declaratort::name(), irept::set(), typet::subtype(), symbolt::type, exprt::type(), and cpp_declaratort::value().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 218 of file cpp_typecheck.cpp.
References exprt::add_source_location(), symbolt::base_name, convert_function(), default_assignop_value(), Forall_symbols, irept::get(), irept::get_bool(), irept::id(), symbolt::location, namespacet::lookup(), irept::make_nil(), exprt::op0(), exprt::operands(), irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, symbolt::type, symbolt::value, and cpp_declaratort::value().
Referenced by typecheck().
|
protected |
Definition at line 17 of file cpp_typecheck_virtual_table.cpp.
References symbolt::base_name, struct_union_typet::components(), irept::get(), irept::get_bool(), struct_union_typet::componentt::get_name(), irept::id(), id2string(), symbolt::is_lvalue, symbolt::is_static_lifetime, symbolt::location, symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, namespacet::namespacet(), exprt::operands(), code_typet::parameters(), pointer_type(), c_typecheck_baset::symbol_table, to_code_type(), to_pointer_type(), to_struct_type(), symbolt::type, exprt::type(), and symbolt::value.
Referenced by typecheck_compound_body().
produces destructor code for a class object
Note:
Definition at line 61 of file cpp_typecheck_destructor.cpp.
References exprt::add_source_location(), already_typechecked(), symbolt::base_name, struct_union_typet::components(), cpp_destructor(), cpp_is_pod(), irept::find(), irept::get_sub(), irept::id(), id2string(), irept::is_not_nil(), is_reference(), namespacet::lookup(), exprt::move_to_operands(), irept::move_to_sub(), symbolt::name, namespacet::namespacet(), exprt::operands(), irept::set(), source_locationt::set_function(), typet::source_location(), symbolt::symbol_expr(), c_typecheck_baset::symbol_table, to_struct_union_type(), symbolt::type, and exprt::type().
Referenced by convert_function(), and typecheck_compound_body().
Definition at line 1720 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), cast_away_constness(), irept::find(), namespace_baset::follow(), irept::get_bool(), irept::id(), irept::is_not_nil(), is_reference(), exprt::op0(), standard_conversion_lvalue_to_rvalue(), static_typecast(), typet::subtype(), and exprt::type().
Referenced by typecheck_cast_expr(), and typecheck_compound_body().
|
protected |
elaborate class template instances
Definition at line 186 of file cpp_instantiate_template.cpp.
References irept::find(), irept::get(), irept::get_bool(), irept::id(), instantiate_template(), namespacet::lookup(), typet::source_location(), and symbolt::type.
Referenced by convert_non_template_declaration(), cpp_constructor(), cpp_destructor(), cpp_typecheck_resolvet::resolve_scope(), typecheck_compound_bases(), typecheck_compound_declarator(), and typecheck_expr_member().
|
protected |
|
protected |
Definition at line 2720 of file cpp_typecheck_expr.cpp.
References exprt::add_source_location(), cpp_typecheck_resolvet::BOTH, irept::id(), exprt::op0(), exprt::op1(), exprt::operands(), resolve(), exprt::source_location(), irept::swap(), to_cpp_name(), and exprt::type().
Referenced by typecheck_compound_body(), and typecheck_expr().
|
protected |
Definition at line 977 of file cpp_typecheck_constructor.cpp.
References struct_union_typet::components(), irept::get(), irept::get_bool(), is_reference(), symbolt::name, code_typet::parameters(), typet::subtype(), to_code_type(), to_struct_type(), symbolt::type, and exprt::type().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 920 of file cpp_typecheck_constructor.cpp.
References struct_union_typet::components(), irept::get(), irept::get_bool(), irept::id(), is_reference(), symbolt::name, code_typet::parameters(), c_typecheck_baset::return_type, typet::subtype(), to_code_type(), to_struct_type(), symbolt::type, and exprt::type().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 14 of file cpp_typecheck_destructor.cpp.
References symbolt::base_name, irept::find(), forall_irep, irept::get_sub(), id2string(), and symbolt::type.
|
protected |
Definition at line 34 of file cpp_typecheck_expr.cpp.
References irept::find(), forall_irep, irept::get_sub(), namespacet::lookup(), and symbolt::type.
|
protected |
Build the full initialization list of the constructor.
First, all the direct-parent constructors are called. Second, all the non-pod data members are initialized.
Note: The initialization order follows the declaration order.
struct_union_type | the class/struct/union |
initializers | the constructor initializers |
Definition at line 655 of file cpp_typecheck_constructor.cpp.
References irept::add(), exprt::add_source_location(), already_typechecked(), symbolt::base_name, struct_union_typet::components(), cpp_is_pod(), messaget::eom(), messaget::error(), irept::find(), forall_irep, Forall_irep, irept::get(), cpp_namet::get_base_name(), irept::get_sub(), get_virtual_bases(), cpp_namet::has_template_args(), irept::id(), id2string(), namespacet::lookup(), exprt::move_to_operands(), irept::move_to_sub(), symbolt::name, exprt::operands(), irept::set(), messaget::mstreamt::source_location, irept::swap(), to_cpp_name(), to_struct_type(), symbolt::type, exprt::type(), and typecheck_type().
Referenced by cpp_declarator_convertert::convert(), and typecheck_compound_body().
for function overloading
Definition at line 143 of file cpp_typecheck_function.cpp.
References cpp_type2name(), irept::get_bool(), code_typet::parameters(), messaget::result(), typet::subtype(), template_subtype(), and to_code_type().
Referenced by cpp_declarator_convertert::get_final_identifier(), typecheck_compound_body(), typecheck_compound_declarator(), and typecheck_member_function().
|
protected |
Definition at line 482 of file cpp_typecheck_template.cpp.
References class_template_identifier(), and cpp_type2name().
Referenced by typecheck_function_template().
void cpp_typecheckt::get_bases | ( | const struct_typet & | type, |
std::set< irep_idt > & | set_bases | ||
) | const |
Definition at line 1626 of file cpp_typecheck_compound_type.cpp.
References irept::find(), forall_irep, irept::get_sub(), namespacet::lookup(), and to_struct_type().
Referenced by subtype_typecast(), and typecheck_compound_body().
|
protected |
Definition at line 1461 of file cpp_typecheck_compound_type.cpp.
References exprt::add_source_location(), check_component_access(), disable_access_control, messaget::error(), namespace_baset::follow(), irept::id(), irept::is_not_nil(), irept::set(), messaget::mstreamt::source_location, irept::swap(), to_struct_union_type(), and exprt::type().
Referenced by typecheck_expr_member(), and typecheck_side_effect_function_call().
void cpp_typecheckt::get_virtual_bases | ( | const struct_typet & | type, |
std::list< irep_idt > & | vbases | ||
) | const |
Definition at line 1645 of file cpp_typecheck_compound_type.cpp.
References irept::find(), forall_irep, irept::get(), irept::get_sub(), namespacet::lookup(), and to_struct_type().
Referenced by full_member_initialization(), and typecheck_compound_body().
|
staticprotected |
Definition at line 28 of file cpp_typecheck_compound_type.cpp.
References forall_subtypes, and irept::id().
Referenced by add_this_to_method_type(), typecheck_compound_body(), and typecheck_compound_declarator().
|
staticprotected |
Definition at line 44 of file cpp_typecheck_compound_type.cpp.
References forall_subtypes, and irept::id().
Referenced by add_this_to_method_type(), typecheck_compound_body(), and typecheck_compound_declarator().
bool cpp_typecheckt::implicit_conversion_sequence | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
unsigned & | rank | ||
) |
implicit conversion sequence
Definition at line 1453 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), is_reference(), reference_binding(), irept::set(), simplify_exprt::simplify(), simplify(), standard_conversion_sequence(), exprt::type(), and user_defined_conversion_sequence().
Referenced by implicit_conversion_sequence(), implicit_typecast(), cpp_typecheck_fargst::match(), reference_binding(), static_typecast(), typecheck_compound_body(), typecheck_expr_trinary(), and user_defined_conversion_sequence().
bool cpp_typecheckt::implicit_conversion_sequence | ( | const exprt & | expr, |
const typet & | type, | ||
unsigned & | rank | ||
) |
implicit conversion sequence
Definition at line 1509 of file cpp_typecheck_conversions.cpp.
References implicit_conversion_sequence().
bool cpp_typecheckt::implicit_conversion_sequence | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) |
implicit conversion sequence
Definition at line 1495 of file cpp_typecheck_conversions.cpp.
References implicit_conversion_sequence().
Reimplemented from c_typecheck_baset.
Definition at line 1518 of file cpp_typecheck_conversions.cpp.
References messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), implicit_conversion_sequence(), irept::pretty(), show_instantiation_stack(), messaget::mstreamt::source_location, to_string(), and exprt::type().
Referenced by convert_initializer(), typecheck_compound_body(), typecheck_enum_body(), typecheck_expr_new(), typecheck_expr_trinary(), typecheck_method_application(), typecheck_template_args(), and typecheck_type().
|
protected |
Definition at line 216 of file cpp_instantiate_template.cpp.
References irept::add(), typet::add_source_location(), cpp_scopet::add_using_scope(), template_mapt::apply(), cpp_template_args_baset::arguments(), symbolt::base_name, template_mapt::build(), cpp_idt::CLASS, struct_union_typet::components(), convert(), convert_non_template_declaration(), cpp_scopes, cpp_scopest::current_scope(), cpp_declarationt::declarators(), dstringt::empty(), messaget::eom(), messaget::error(), irept::find(), forall_expr, irept::get(), cpp_scopet::get_parent(), cpp_scopest::get_scope(), irept::get_sub(), cpp_scopest::go_to(), cpp_template_args_tct::has_unassigned(), irept::id(), id2string(), cpp_idt::id_class, cpp_scopest::id_map, id_set, cpp_idt::identifier, instantiation_stack, INVARIANT_STRUCTURED, cpp_storage_spect::is_auto(), cpp_idt::is_class(), cpp_storage_spect::is_extern(), cpp_storage_spect::is_mutable(), irept::is_not_nil(), cpp_storage_spect::is_register(), cpp_storage_spect::is_static(), cpp_declarationt::is_typedef(), cpp_member_spect::is_virtual(), cpp_scopet::lookup(), namespacet::lookup(), MAX_DEPTH, cpp_declarationt::member_spec(), symbolt::name, cpp_scopet::new_scope(), exprt::operands(), cpp_idt::prefix, template_mapt::print(), irept::remove(), cpp_save_scopet::restore(), cpp_scopet::SCOPE_ONLY, irept::set(), exprt::source_location(), messaget::mstreamt::source_location, cpp_declarationt::storage_spec(), cpp_idt::suffix, irept::swap(), cpp_idt::SYMBOL, c_typecheck_baset::symbol_table, symbol_tablet::symbols, template_map, cpp_idt::TEMPLATE_SCOPE, template_suffix(), cpp_declarationt::template_type(), to_cpp_declaration(), to_string(), to_struct_type(), symbolt::type, exprt::type(), typecheck_compound_declarator(), typecheck_template_parameters(), and symbolt::value.
Referenced by cpp_typecheck_resolvet::apply_template_args(), convert_class_template_specialization(), convert_template_function_or_member_specialization(), cpp_typecheck_resolvet::disambiguate_template_classes(), elaborate_class_template(), and cpp_typecheck_resolvet::guess_function_template_args().
Definition at line 1683 of file cpp_typecheck_compound_type.cpp.
References namespace_baset::follow(), irept::id(), exprt::make_typecast(), typet::subtype(), subtype_typecast(), to_struct_type(), and exprt::type().
Referenced by reference_binding(), standard_conversion_pointer(), static_typecast(), typecheck_compound_body(), typecheck_member_initializer(), and user_defined_conversion_sequence().
|
protected |
Definition at line 1209 of file cpp_typecheck_compound_type.cpp.
References messaget::eom(), messaget::error(), irept::find(), forall_irep, irept::get_sub(), irept::id(), irept::is_nil(), codet::make_block(), exprt::operands(), messaget::mstreamt::source_location, and to_code().
Referenced by cpp_declarator_convertert::handle_initializer(), typecheck_compound_body(), and typecheck_member_function().
|
protected |
Definition at line 310 of file cpp_constructor.cpp.
References irept::add(), exprt::add_source_location(), already_typechecked(), cpp_constructor(), irept::get(), irept::is_not_nil(), exprt::move_to_operands(), exprt::op1(), irept::set(), exprt::source_location(), irept::swap(), and exprt::type().
Referenced by new_temporary(), reference_binding(), static_typecast(), typecheck_expr_explicit_constructor_call(), and typecheck_function_call_arguments().
|
protected |
Definition at line 342 of file cpp_constructor.cpp.
References new_temporary().
|
protected |
Definition at line 477 of file cpp_typecheck_expr.cpp.
References irept::add(), add_implicit_dereference(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), struct_union_typet::components(), exprt::copy_to_operands(), cpp_scopes, cpp_type2name(), dstringt::empty(), namespace_baset::follow(), forall_operands, side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), irept::get_sub(), cpp_typecheck_fargst::has_object, irept::id(), operator_entryt::id, cpp_typecheck_fargst::in_use, irept::is_not_nil(), exprt::move_to_operands(), exprt::op0(), cpp_typecheck_fargst::operands, exprt::operands(), operators, overloadable(), resolve(), cpp_scopest::set_scope(), exprt::source_location(), irept::swap(), to_struct_type(), exprt::type(), typecheck_expr(), typecheck_side_effect_function_call(), typecheck_type(), and cpp_typecheck_resolvet::VAR.
Referenced by typecheck_compound_body(), and typecheck_expr_main().
|
protected |
Definition at line 424 of file cpp_typecheck_expr.cpp.
References namespace_baset::follow(), forall_operands, irept::id(), is_reference(), and typet::subtype().
Referenced by operator_is_overloaded(), and typecheck_compound_body().
|
protected |
Definition at line 767 of file cpp_typecheck_compound_type.cpp.
References cpp_idt::BLOCK_SCOPE, dstringt::c_str(), cpp_idt::class_identifier, cpp_scopes, cpp_scopest::current_scope(), dstringt::empty(), messaget::eom(), messaget::error(), irept::find(), irept::get(), struct_union_typet::componentt::get_base_name(), irept::get_bool(), struct_union_typet::componentt::get_name(), irept::get_string(), irept::id(), id_block, cpp_idt::id_class, cpp_scopest::id_map, id_set, cpp_idt::identifier, cpp_scopet::insert(), cpp_idt::is_method, cpp_idt::is_scope, cpp_idt::is_static_member, cpp_scopet::lookup(), cpp_idt::prefix, cpp_scopet::SCOPE_ONLY, exprt::source_location(), messaget::mstreamt::source_location, cpp_idt::SYMBOL, exprt::type(), and cpp_idt::TYPEDEF.
Referenced by add_method_body(), convert_anon_struct_union_member(), typecheck_compound_bases(), and typecheck_compound_declarator().
bool cpp_typecheckt::reference_binding | ( | exprt | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
unsigned & | rank | ||
) |
Reference binding.
When a parameter of reference type binds directly (8.5.3) to an argument expression, the implicit conversion sequence is the identity conversion, unless the argument expression has a type that is a derived class of the parameter type, in which case the implicit conversion sequence is a derived-to-base Conversion (13.3.3.1).
If the parameter binds directly to the result of applying a conversion function to the argument expression, the implicit conversion sequence is a user-defined conversion sequence (13.3.3.1.2), with the second standard conversion sequence either an identity conversion or, if the conversion function returns an entity of a type that is a derived class of the parameter type, a derived-to-base Conversion.
When a parameter of reference type is not bound directly to an argument expression, the conversion sequence is the one required to convert the argument expression to the underlying type of the reference according to 13.3.3.1. Conceptually, this conversion sequence corresponds to copy-initializing a temporary of the underlying type with the argument expression. Any difference in top-level cv-qualification is subsumed by the initialization itself and does not constitute a conversion.
A standard conversion sequence cannot be formed if it requires binding a reference to non-const to an rvalue (except when binding an implicit object parameter; see the special rules for that case in 13.3.1).
Definition at line 1247 of file cpp_typecheck_conversions.cpp.
References irept::add(), add_implicit_dereference(), exprt::add_source_location(), struct_union_typet::components(), exprt::copy_to_operands(), irept::find(), namespace_baset::follow(), from_type(), side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), irept::get_sub(), irept::id(), implicit_conversion_sequence(), is_reference(), make_ptr_typecast(), exprt::make_typecast(), exprt::move_to_operands(), new_temporary(), address_of_exprt::object(), exprt::op0(), code_typet::parameters(), pointer_type(), c_qualifierst::read(), reference_compatible(), irept::remove(), code_typet::return_type(), irept::set(), exprt::source_location(), standard_conversion_sequence(), typet::subtype(), irept::swap(), to_code_type(), to_struct_type(), exprt::type(), typecheck_side_effect_function_call(), user_defined_conversion_sequence(), and c_qualifierst::write().
Referenced by implicit_conversion_sequence(), reference_initializer(), static_typecast(), and typecheck_compound_body().
bool cpp_typecheckt::reference_compatible | ( | const exprt & | expr, |
const typet & | type, | ||
unsigned & | rank | ||
) | const |
Reference-compatible.
Definition at line 1184 of file cpp_typecheck_conversions.cpp.
References is_reference(), c_qualifierst::is_subset_of(), c_qualifierst::read(), reference_related(), typet::subtype(), and exprt::type().
Referenced by reference_binding(), and typecheck_compound_body().
A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows:
If the initializer expression
then the reference is bound directly to the initializer expression lvalue in the first case, and the reference is bound to the lvalue result of the conversion in the second case. In these cases the reference is said to bind directly to the initializer expression.
If the initializer expression is an rvalue, with T2 a class type, and "cv1 T1" is reference-compatible with "cv2 T2," the reference is bound in one of the following ways (the choice is implementation-defined):
The constructor that would be used to make the copy shall be callable whether or not the copy is actually done.
Otherwise, a temporary of type "cv1 T1" is created and initialized from the initializer expression using the rules for a non-reference copy initialization (8.5). The reference is then bound to the temporary. If T1 is reference-related to T2, cv1 must be the same cv-qualification as, or greater cvqualification than, cv2; otherwise, the program is ill-formed.
Definition at line 1579 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), messaget::eom(), messaget::error(), exprt::find_source_location(), is_reference(), reference_binding(), messaget::mstreamt::source_location, and irept::swap().
Referenced by convert_initializer(), typecheck_compound_body(), and typecheck_member_initializer().
Reference-related.
Definition at line 1147 of file cpp_typecheck_conversions.cpp.
References namespace_baset::follow(), irept::get(), irept::get_bool(), irept::id(), is_reference(), typet::subtype(), subtype_typecast(), to_struct_type(), and exprt::type().
Referenced by reference_compatible(), and typecheck_compound_body().
bool cpp_typecheckt::reinterpret_typecast | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
bool | check_constantness = true |
||
) |
Definition at line 1772 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), cast_away_constness(), irept::get_bool(), irept::id(), is_reference(), exprt::is_zero(), exprt::make_typecast(), exprt::op0(), irept::set(), simplify_expr(), standard_conversion_array_to_pointer(), standard_conversion_function_to_pointer(), standard_conversion_lvalue_to_rvalue(), irept::swap(), and exprt::type().
Referenced by typecheck_cast_expr(), typecheck_compound_body(), and typecheck_expr_explicit_typecast().
|
inline |
Definition at line 87 of file cpp_typecheck.h.
References cpp_constructor(), cpp_is_pod(), cpp_typecheck_resolvet::resolve(), and typecheck_expr().
Referenced by cpp_declarator_convertert::convert(), convert_initializer(), explicit_typecast_ambiguity(), operator_is_overloaded(), typecheck_compound_bases(), typecheck_expr_cpp_name(), typecheck_expr_explicit_typecast(), typecheck_expr_member(), typecheck_expr_sizeof(), typecheck_member_initializer(), and typecheck_type().
|
protected |
Definition at line 23 of file cpp_typecheck_template.cpp.
References template_typet::template_parameters().
Referenced by typecheck_class_template().
|
protected |
Definition at line 84 of file cpp_instantiate_template.cpp.
References forall_expr, instantiation_stack, namespacet::lookup(), symbolt::pretty_name, and to_string().
Referenced by cpp_typecheck_resolvet::disambiguate_template_classes(), implicit_typecast(), cpp_typecheck_resolvet::resolve(), and cpp_typecheck_resolvet::resolve_scope().
bool cpp_typecheckt::standard_conversion_array_to_pointer | ( | const exprt & | expr, |
exprt & | new_expr | ||
) | const |
Array-to-pointer conversion.
An lvalue or rvalue of type "array of N T" or "array of unknown bound of T" can be converted to an rvalue of type "pointer to T." The result is a pointer to the first element of the array.
Definition at line 70 of file cpp_typecheck_conversions.cpp.
References from_integer(), irept::id(), index_type(), and exprt::type().
Referenced by const_typecast(), reinterpret_typecast(), standard_conversion_sequence(), typecheck_compound_body(), and typecheck_expr_trinary().
Boolean conversion.
An rvalue of arithmetic, enumeration, pointer, or pointer to member type can be converted to an rvalue of type bool. A zero value, null pointer value, or null member pointer value is converted to false; any other value is converted to true.
Definition at line 629 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), exprt::make_typecast(), c_qualifierst::read(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_floating_integral_conversion | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) | const |
Floating-integral conversion.
An rvalue of a floating point type can be converted to an rvalue of an integer type. The conversion truncates; that is, the fractional part is discarded. The behavior is undefined if the truncated value cannot be represented in the destination type. [Note: If the destination type is bool, see 4.12. ]
An rvalue of an integer type or of an enumeration type can be converted to an rvalue of a floating point type. The result is exact if possible. Otherwise, it is an implementation-defined choice of either the next lower or higher representable value. [Note: loss of precision occurs if the integral value cannot be represented exactly as a value of the floating type. ] If the source type is bool, the value false is converted to zero and the value true is converted to one.
Definition at line 341 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), exprt::make_typecast(), c_qualifierst::read(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_floating_point_conversion | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) | const |
Floating-point conversion.
An rvalue of floating point type can be converted to an rvalue of another floating point type. If the source value can be exactly represented in the destination type, the result of the conversion is that exact representation. If the source value is between two adjacent destination values, the result of the conversion is an implementation-defined choice of either of those values. Otherwise, the behavior is undefined.
The conversions allowed as floating point promotions are excluded from the set of floating point conversions.
Definition at line 393 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), exprt::make_typecast(), c_qualifierst::read(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_floating_point_promotion | ( | const exprt & | expr, |
exprt & | new_expr | ||
) | const |
Floating-point-promotion conversion.
An rvalue of type float can be converted to an rvalue of type double. The value is unchanged.
Definition at line 240 of file cpp_typecheck_conversions.cpp.
References configt::ansi_c, config, double_type(), float_type(), irept::get_bool(), exprt::make_typecast(), c_qualifierst::read(), configt::ansi_ct::single_width, to_floatbv_type(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_function_to_pointer | ( | const exprt & | expr, |
exprt & | new_expr | ||
) | const |
Function-to-pointer conversion.
An lvalue of function type T can be converted to an rvalue of type "pointer to T." The result is a pointer to the function.50)
Definition at line 94 of file cpp_typecheck_conversions.cpp.
References irept::get_bool().
Referenced by const_typecast(), reinterpret_typecast(), standard_conversion_sequence(), typecheck_compound_body(), and typecheck_expr_trinary().
bool cpp_typecheckt::standard_conversion_integral_conversion | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) | const |
Integral conversion.
An rvalue of type char, signed char, unsigned char, short int, An rvalue of an integer type can be converted to an rvalue of another integer type. An rvalue of an enumeration type can be converted to an rvalue of an integer type.
If the destination type is unsigned, the resulting value is the least unsigned integer congruent to the source integer (modulo 2n where n is the number of bits used to represent the unsigned type). [Note: In a two's complement representation, this conversion is conceptual and there is no change in the bit pattern (if there is no truncation). ]
If the destination type is signed, the value is unchanged if it can be represented in the destination type (and bit-field width); otherwise, the value is implementation-defined.
If the destination type is bool, see 4.12. If the source type is bool, the value false is converted to zero and the value true is converted to one.
The conversions allowed as integral promotions are excluded from the set of integral conversions.
Definition at line 295 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), exprt::make_typecast(), c_qualifierst::read(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_integral_promotion | ( | const exprt & | expr, |
exprt & | new_expr | ||
) | const |
Integral-promotion conversion.
An rvalue of type char, signed char, unsigned char, short int, or unsigned short int can be converted to an rvalue of type int if int can represent all the values of the source type; otherwise, the source rvalue can be converted to an rvalue of type unsigned int.
An rvalue of type wchar_t (3.9.1) or an enumeration type (7.2) can be converted to an rvalue of the first of the following types that can represent all the values of its underlying type: int, unsigned int, long, or unsigned long.
An rvalue for an integral bit-field (9.6) can be converted to an rvalue of type int if int can represent all the values of the bit-field; otherwise, it can be converted to unsigned int if unsigned int can represent all the values of the bit-field. If the bit-field is larger yet, no integral promotion applies to it. If the bit-field has an enumerated type, it is treated as any other value of that type for promotion purposes.
An rvalue of type bool can be converted to an rvalue of type int, with false becoming zero and true becoming one.
Definition at line 188 of file cpp_typecheck_conversions.cpp.
References configt::ansi_c, config, irept::get_bool(), irept::id(), configt::ansi_ct::int_width, exprt::make_typecast(), c_qualifierst::read(), signed_int_type(), to_signedbv_type(), to_unsignedbv_type(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_lvalue_to_rvalue | ( | const exprt & | expr, |
exprt & | new_expr | ||
) | const |
Lvalue-to-rvalue conversion.
An lvalue (3.10) of a non-function, non-array type T can be converted to an rvalue. If T is an incomplete type, a program that necessitates this conversion is ill-formed. If the object to which the lvalue refers is not an object of type T and is not an object of a type derived from T, or if the object is uninitialized, a program that necessitates this conversion has undefined behavior. If T is a non-class type, the type of the rvalue is the cv-unqualified version of T. Otherwise, the type of the rvalue is T.
The value contained in the object indicated by the lvalue is the rvalue result. When an lvalue-to-rvalue conversion occurs within the operand of sizeof (5.3.3) the value contained in the referenced object is not accessed, since that operator does not evaluate its operand.
Definition at line 45 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), irept::remove(), and exprt::type().
Referenced by const_typecast(), dynamic_typecast(), reinterpret_typecast(), standard_conversion_sequence(), static_typecast(), typecheck_compound_body(), and typecheck_expr_trinary().
bool cpp_typecheckt::standard_conversion_pointer | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) |
Pointer conversion.
A null pointer constant is an integral constant expression (5.19) rvalue of integer type that evaluates to zero. A null pointer constant can be converted to a pointer type; the result is the null pointer value of that type and is distinguishable from every other value of pointer to object or pointer to function type. Two null pointer values of the same type shall compare equal. The conversion of a null pointer constant to a pointer to cv-qualified type is a single conversion, and not the sequence of a pointer conversion followed by a qualification conversion (4.4).
An rvalue of type "pointer to cv T," where T is an object type, can be converted to an rvalue of type "pointer to cv void." The result of converting a "pointer to cv T" to a "pointer to cv void" points to the start of the storage location where the object of type T resides, as if the object is a most derived object (1.8) of type T (that is, not a base class subobject).
An rvalue of type "pointer to cv D," where D is a class type, can be converted to an rvalue of type "pointer to cv B," where B is a base class (clause 10) of D. If B is an inaccessible (clause 11) or ambiguous (10.2) base class of D, a program that necessitates this conversion is ill-formed. The result of the conversion is a pointer to the base class sub-object of the derived class object. The null pointer value is converted to the null pointer value of the destination type.
Definition at line 451 of file cpp_typecheck_conversions.cpp.
References irept::find(), namespace_baset::follow(), irept::get_bool(), irept::id(), irept::is_not_nil(), is_reference(), exprt::is_zero(), make_ptr_typecast(), exprt::make_typecast(), c_qualifierst::read(), irept::set(), simplify_expr(), typet::subtype(), subtype_typecast(), to_struct_type(), exprt::type(), and c_qualifierst::write().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_pointer_to_member | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) |
Pointer-to-member conversion.
A null pointer constant (4.10) can be converted to a pointer to member type; the result is the null member pointer value of that type and is distinguishable from any pointer to member not created from a null pointer constant. Two null member pointer values of the same type shall compare equal. The conversion of a null pointer constant to a pointer to member of cv-qualified type is a single conversion, and not the sequence of a pointer to member conversion followed by a qualification conversion (4.4).
An rvalue of type "pointer to member of B of type cv T," where B is a class type, can be converted to an rvalue of type "pointer to member of D of type cv T," where D is a derived class (clause 10) of B. If B is an inaccessible (clause 11), ambiguous (10.2) or virtual (10.1) base class of D, a program that necessitates this conversion is ill-formed. The result of the conversion refers to the same member as the pointer to member before the conversion took place, but it refers to the base class member as if it were a member of the derived class. The result refers to the member in D"s instance of B. Since the result has type "pointer to member of D of type cv T," it can be dereferenced with a D object. The result is the same as if the pointer to member of B were dereferenced with the B sub-object of D. The null member pointer value is converted to the null member pointer value of the destination type.52)
Definition at line 547 of file cpp_typecheck_conversions.cpp.
References irept::find(), namespace_baset::follow(), irept::get(), irept::get_bool(), irept::id(), irept::is_nil(), is_reference(), exprt::make_typecast(), code_typet::parameters(), typet::subtype(), subtype_typecast(), to_code_type(), to_struct_type(), and exprt::type().
Referenced by standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_qualification | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr | ||
) | const |
Qualification conversion.
Definition at line 110 of file cpp_typecheck_conversions.cpp.
References irept::get_bool(), irept::id(), c_qualifierst::is_constant, is_reference(), c_qualifierst::is_subset_of(), typet::subtype(), irept::swap(), and exprt::type().
Referenced by cast_away_constness(), standard_conversion_sequence(), and typecheck_compound_body().
bool cpp_typecheckt::standard_conversion_sequence | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
unsigned & | rank | ||
) |
Standard Conversion Sequence.
A standard conversion sequence is a sequence of standard conversions in the following order:
Definition at line 672 of file cpp_typecheck_conversions.cpp.
References irept::find(), namespace_baset::follow(), irept::get(), irept::id(), is_reference(), exprt::make_typecast(), c_qualifierst::read(), standard_conversion_array_to_pointer(), standard_conversion_boolean(), standard_conversion_floating_integral_conversion(), standard_conversion_floating_point_conversion(), standard_conversion_floating_point_promotion(), standard_conversion_function_to_pointer(), standard_conversion_integral_conversion(), standard_conversion_integral_promotion(), standard_conversion_lvalue_to_rvalue(), standard_conversion_pointer(), standard_conversion_pointer_to_member(), standard_conversion_qualification(), typet::subtype(), irept::swap(), and exprt::type().
Referenced by implicit_conversion_sequence(), reference_binding(), typecheck_compound_body(), and user_defined_conversion_sequence().
|
protected |
Initialization of static objects:
"Objects with static storage duration (3.7.1) shall be zero-initialized (8.5) before any other initialization takes place. Zero-initialization and initialization with a constant expression are collectively called static initialization; all other initialization is dynamic initialization. Objects of POD types (3.9) with static storage duration initialized with constant expressions (5.19) shall be initialized before any dynamic initialization takes place. Objects with static storage duration defined in namespace scope in the same translation unit and dynamically initialized shall be initialized in the order in which their definition appears in the translation unit. [Note: 8.5.1 describes the order in which aggregate members are initialized. The initialization of local static objects is described in 6.7. ]"
Definition at line 148 of file cpp_typecheck.cpp.
References irept::add(), symbolt::base_name, exprt::copy_to_operands(), cpp_constructor(), cpp_is_pod(), cpp_symbol_expr(), disable_access_control, dynamic_initializations, irept::id(), id2string(), symbolt::is_extern, symbolt::is_macro, irept::is_not_nil(), symbolt::is_static_lifetime, symbolt::is_type, symbolt::location, irept::make_nil(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), exprt::move_to_operands(), symbolt::name, irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, symbolt::type, and symbolt::value.
Referenced by typecheck().
bool cpp_typecheckt::static_typecast | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
bool | check_constantness = true |
||
) |
Definition at line 1874 of file cpp_typecheck_conversions.cpp.
References add_implicit_dereference(), cast_away_constness(), exprt::copy_to_operands(), cpp_is_pod(), irept::find(), namespace_baset::follow(), irept::get_bool(), irept::id(), implicit_conversion_sequence(), irept::is_nil(), irept::is_not_nil(), c_qualifierst::is_subset_of(), make_ptr_typecast(), exprt::make_typecast(), new_temporary(), exprt::op0(), c_qualifierst::read(), reference_binding(), irept::remove(), irept::set(), exprt::source_location(), standard_conversion_lvalue_to_rvalue(), typet::subtype(), subtype_typecast(), irept::swap(), to_struct_type(), and exprt::type().
Referenced by dynamic_typecast(), typecheck_cast_expr(), typecheck_compound_body(), and typecheck_expr_explicit_typecast().
bool cpp_typecheckt::subtype_typecast | ( | const struct_typet & | from, |
const struct_typet & | to | ||
) | const |
Definition at line 1669 of file cpp_typecheck_compound_type.cpp.
References irept::get(), and get_bases().
Referenced by check_component_access(), convert_pmop(), cpp_typecheck_resolvet::disambiguate_functions(), make_ptr_typecast(), reference_related(), standard_conversion_pointer(), standard_conversion_pointer_to_member(), static_typecast(), typecheck_compound_body(), and user_defined_conversion_sequence().
|
protected |
Definition at line 60 of file cpp_typecheck_compound_type.cpp.
References cpp_scopes, cpp_scopest::current_scope(), cpp_scopest::get_global_scope(), id_set, cpp_scopet::lookup(), and cpp_scopet::RECURSIVE.
Referenced by add_method_body(), typecheck_compound_type(), and typecheck_enum_type().
|
protected |
Definition at line 22 of file cpp_instantiate_template.cpp.
References cpp_template_args_baset::arguments(), cpp_type2name(), messaget::eom(), messaget::error(), irept::get_string(), irept::id(), integer2string(), exprt::is_false(), exprt::is_true(), c_typecheck_baset::make_constant(), messaget::result(), messaget::mstreamt::source_location, to_integer(), to_string(), and exprt::type().
Referenced by class_template_symbol(), and instantiate_template().
|
protected |
Definition at line 63 of file cpp_typecheck.cpp.
References cpp_scopes, cpp_scopest::current_scope(), namespace_baset::follow(), irept::id(), irept::is_not_nil(), typet::subtype(), cpp_idt::this_expr, to_struct_type(), and exprt::type().
Referenced by typecheck_compound_body().
|
virtual |
Reimplemented from c_typecheck_baset.
Definition at line 81 of file cpp_typecheck.cpp.
References type2cpp().
Referenced by cpp_declarator_convertert::combine_types(), convert_initializer(), cpp_constructor(), cpp_destructor(), cpp_declarator_convertert::get_pretty_name(), cpp_typecheck_resolvet::guess_template_args(), implicit_typecast(), instantiate_template(), cpp_typecheck_fargst::match(), cpp_typecheck_resolvet::resolve(), cpp_typecheck_resolvet::show_identifiers(), show_instantiation_stack(), template_suffix(), typecheck_cast_expr(), typecheck_compound_bases(), typecheck_expr_delete(), typecheck_expr_explicit_typecast(), typecheck_expr_member(), typecheck_expr_ptrmember(), typecheck_member_initializer(), typecheck_side_effect_function_call(), and ~cpp_typecheckt().
|
virtual |
Reimplemented from c_typecheck_baset.
Definition at line 76 of file cpp_typecheck.cpp.
References expr2cpp().
|
virtual |
typechecking main method
Implements c_typecheck_baset.
Definition at line 48 of file cpp_typecheck.cpp.
References clean_up(), convert(), cpp_parse_tree, current_linkage_spec, do_not_typechecked(), cpp_parse_treet::items, and static_and_dynamic_initialization().
Referenced by ~cpp_typecheckt().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 453 of file cpp_typecheck_code.cpp.
References exprt::add_source_location(), messaget::eom(), messaget::error(), code_expressiont::expression(), exprt::find_source_location(), irept::get(), exprt::operands(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), and typecheck_expr().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 445 of file cpp_typecheck_code.cpp.
References cpp_scopes, cpp_scopest::new_block_scope(), and c_typecheck_baset::typecheck_block().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 1291 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), side_effect_expr_function_callt::arguments(), const_typecast(), dynamic_typecast(), messaget::eom(), messaget::error(), exprt::find_source_location(), side_effect_expr_function_callt::function(), irept::get_sub(), irept::id(), reinterpret_typecast(), exprt::source_location(), messaget::mstreamt::source_location, static_typecast(), irept::swap(), to_side_effect_expr_function_call(), to_string(), exprt::type(), and typecheck_type().
Referenced by typecheck_compound_body(), and typecheck_side_effect_function_call().
|
protected |
Definition at line 44 of file cpp_typecheck_template.cpp.
References symbolt::base_name, dstringt::c_str(), class_template_identifier(), cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), irept::find(), cpp_namet::get_base_name(), id2string(), cpp_idt::id_class, cpp_scopest::id_map, id_set, symbolt::is_macro, irept::is_nil(), irept::is_not_nil(), cpp_namet::is_simple_name(), symbolt::location, cpp_scopet::lookup(), namespacet::lookup(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_declarationt::partial_specialization_args(), cpp_idt::prefix, symbolt::pretty_name, cpp_scopest::put_into_scope(), salvage_default_arguments(), cpp_scopet::SCOPE_ONLY, dstringt::size(), cpp_namet::source_location(), messaget::mstreamt::source_location, irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, cpp_idt::TEMPLATE, cpp_idt::TEMPLATE_SCOPE, cpp_declarationt::template_type(), to_cpp_declaration(), symbolt::type, exprt::type(), typecheck_template_parameters(), and symbolt::value.
Referenced by convert_class_template_specialization(), and convert_template_declaration().
|
protected |
typecheck class template members; these can be methods or static members
Definition at line 311 of file cpp_typecheck_template.cpp.
References irept::add(), template_mapt::build(), convert(), exprt::copy_to_operands(), cpp_scopes, cpp_scopest::current_scope(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), irept::get_sub(), cpp_scopest::go_to(), cpp_namet::has_template_args(), id_set, cpp_idt::identifier, cpp_namet::is_qualified(), cpp_scopet::lookup(), irept::remove(), cpp_save_scopet::restore(), cpp_scopet::SCOPE_ONLY, cpp_namet::source_location(), messaget::mstreamt::source_location, c_typecheck_baset::symbol_table, symbol_tablet::symbols, cpp_idt::TEMPLATE, template_map, cpp_declarationt::template_type(), to_cpp_name(), typecheck_template_parameters(), and symbolt::value.
Referenced by convert_template_declaration().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 22 of file cpp_typecheck_code.cpp.
References codet::get_statement(), exprt::type(), c_typecheck_baset::typecheck_code(), typecheck_member_initializer(), and typecheck_try_catch().
Referenced by convert_function(), typecheck_compound_body(), typecheck_expr_delete(), typecheck_ifthenelse(), typecheck_try_catch(), typecheck_while(), and zero_initializer().
|
protected |
Definition at line 16 of file cpp_typecheck_bases.cpp.
References irept::add(), add_base_components(), cpp_scopet::add_secondary_scope(), exprt::add_source_location(), struct_union_typet::components(), cpp_scopes, cpp_scopest::current_scope(), elaborate_class_template(), dstringt::empty(), messaget::eom(), messaget::error(), Forall_irep, irept::get_bool(), irept::get_sub(), irept::id(), cpp_scopest::id_map, namespacet::lookup(), symbolt::name, cpp_idt::prefix, put_compound_into_scope(), resolve(), irept::set(), struct_union_typet::componentt::set_access(), struct_union_typet::componentt::set_name(), cpp_namet::source_location(), typet::source_location(), messaget::mstreamt::source_location, dstringt::swap(), to_cpp_name(), to_string(), to_struct_type(), cpp_typecheck_resolvet::TYPE, symbolt::type, and exprt::type().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 927 of file cpp_typecheck_compound_type.cpp.
References symbolt::base_name, check_member_initializers(), convert_anon_struct_union_member(), convert_template_declaration(), cpp_is_pod(), cpp_scopes, cpp_declarationt::declarators(), default_assignop(), default_cpctor(), default_ctor(), default_dtor(), do_virtual_table(), dtor(), dstringt::empty(), messaget::eom(), messaget::error(), find_assignop(), find_cpctor(), namespace_baset::follow(), Forall_operands, full_member_initialization(), irept::get_bool(), irept::id(), cpp_storage_spect::is_auto(), cpp_declarationt::is_constructor(), cpp_declarationt::is_destructor(), cpp_storage_spect::is_extern(), cpp_member_spect::is_friend(), cpp_storage_spect::is_mutable(), cpp_storage_spect::is_register(), cpp_storage_spect::is_static(), cpp_declarationt::is_template(), cpp_declarationt::is_typedef(), cpp_storage_spect::location(), symbolt::location, cpp_declarationt::member_spec(), exprt::move_to_operands(), symbolt::name, cpp_declarationt::name_anon_struct_union(), irept::remove(), irept::set(), cpp_scopest::set_scope(), typet::source_location(), messaget::mstreamt::source_location, cpp_declarationt::storage_spec(), to_cpp_declaration(), to_struct_type(), to_struct_union_type(), symbolt::type, exprt::type(), typecheck_compound_bases(), typecheck_compound_declarator(), typecheck_friend_declaration(), and typecheck_type().
Referenced by add_method_body(), and typecheck_compound_type().
|
inlineprotectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 383 of file cpp_typecheck.h.
References add_anonymous_members_to_scope(), add_implicit_dereference(), add_this_to_method_type(), const_typecast(), cpp_destructor(), dynamic_typecast(), explicit_typecast_ambiguity(), function_identifier(), get_bases(), get_virtual_bases(), has_const(), has_volatile(), implicit_conversion_sequence(), implicit_typecast(), make_ptr_typecast(), move_member_initializers(), operator_is_overloaded(), overloadable(), reference_binding(), reference_compatible(), reference_initializer(), reference_related(), reinterpret_typecast(), standard_conversion_array_to_pointer(), standard_conversion_boolean(), standard_conversion_floating_integral_conversion(), standard_conversion_floating_point_conversion(), standard_conversion_floating_point_promotion(), standard_conversion_function_to_pointer(), standard_conversion_integral_conversion(), standard_conversion_integral_promotion(), standard_conversion_lvalue_to_rvalue(), standard_conversion_pointer(), standard_conversion_pointer_to_member(), standard_conversion_qualification(), standard_conversion_sequence(), static_typecast(), subtype_typecast(), this_struct_type(), typecheck_assign(), typecheck_block(), typecheck_cast_expr(), typecheck_code(), typecheck_compound_bases(), typecheck_decl(), typecheck_enum_body(), typecheck_expr_address_of(), typecheck_expr_binary_arithmetic(), typecheck_expr_comma(), typecheck_expr_cpp_name(), typecheck_expr_delete(), typecheck_expr_dereference(), typecheck_expr_explicit_constructor_call(), typecheck_expr_explicit_typecast(), typecheck_expr_function_identifier(), typecheck_expr_index(), typecheck_expr_main(), typecheck_expr_member(), typecheck_expr_new(), typecheck_expr_ptrmember(), typecheck_expr_reference_to(), typecheck_expr_rel(), typecheck_expr_side_effect(), typecheck_expr_sizeof(), typecheck_expr_this(), typecheck_expr_throw(), typecheck_expr_trinary(), typecheck_expr_typecast(), typecheck_function_call_arguments(), typecheck_function_expr(), typecheck_ifthenelse(), typecheck_member_function(), typecheck_member_initializer(), typecheck_method_application(), typecheck_method_bodies(), typecheck_side_effect_assignment(), typecheck_side_effect_function_call(), typecheck_side_effect_inc_dec(), typecheck_switch(), typecheck_try_catch(), typecheck_while(), user_defined_conversion_sequence(), and zero_initializer().
|
protected |
Definition at line 254 of file cpp_typecheck_compound_type.cpp.
References irept::add(), exprt::add_source_location(), code_function_callt::arguments(), side_effect_expr_function_callt::arguments(), symbolt::base_name, check_fixed_size_array(), cpp_constructor(), cpp_is_pod(), cpp_scopes, cpp_type2name(), cpp_scopest::current_scope(), c_typecheck_baset::do_initializer(), dynamic_initializations, elaborate_class_template(), dstringt::empty(), messaget::eom(), messaget::error(), irept::find(), code_function_callt::function(), side_effect_expr_function_callt::function(), function_identifier(), irept::get(), cpp_namet::get_base_name(), code_typet::parametert::get_base_name(), irept::get_bool(), struct_union_typet::componentt::get_name(), irept::get_string(), irept::get_sub(), has_const(), has_volatile(), irept::id(), id2string(), cpp_declarationt::is_constructor(), cpp_declarationt::is_destructor(), cpp_member_spect::is_explicit(), symbolt::is_extern, cpp_member_spect::is_inline(), symbolt::is_lvalue, symbolt::is_macro, irept::is_nil(), irept::is_not_nil(), cpp_namet::is_operator(), cpp_namet::is_simple_name(), symbolt::is_static_lifetime, symbolt::is_type, cpp_member_spect::is_virtual(), symbolt::location, namespacet::lookup(), irept::make_nil(), cpp_declaratort::member_initializers(), cpp_declarationt::member_spec(), cpp_declaratort::merge_type(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), cpp_declaratort::name(), symbolt::name, namespacet::namespacet(), exprt::op0(), code_typet::parameters(), pointer_type(), cpp_idt::prefix, symbolt::pretty_name, put_compound_into_scope(), c_typecheck_baset::return_type, code_typet::return_type(), irept::set(), symbol_exprt::set_identifier(), struct_union_typet::componentt::set_name(), simplify(), cpp_namet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, to_code_type(), to_integer(), to_struct_type(), symbolt::type, exprt::type(), typecheck_member_function(), typecheck_type(), symbolt::value, and cpp_declaratort::value().
Referenced by add_method_body(), instantiate_template(), and typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 99 of file cpp_typecheck_compound_type.cpp.
References anon_counter, symbolt::base_name, cpp_idt::CLASS, cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), irept::find(), cpp_namet::get_base_name(), irept::get_bool(), irept::id(), id2string(), cpp_idt::id_class, irept::id_string(), symbolt::is_macro, irept::is_not_nil(), cpp_namet::is_simple_name(), symbolt::is_type, symbolt::location, irept::make_nil(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_idt::prefix, symbolt::pretty_name, cpp_scopest::put_into_scope(), irept::remove(), cpp_typecheck_resolvet::resolve_scope(), irept::set(), typet::source_location(), messaget::mstreamt::source_location, cpp_idt::suffix, irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, tag_scope(), to_cpp_name(), symbolt::type, typecheck_compound_body(), symbolt::value, and c_qualifierst::write().
Referenced by add_method_body(), and typecheck_type().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 352 of file cpp_typecheck_code.cpp.
References exprt::add_source_location(), already_typechecked(), cpp_declarator_convertert::convert(), convert_anonymous_union(), exprt::copy_to_operands(), cpp_constructor(), cpp_symbol_expr(), messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), irept::get_bool(), irept::id(), irept::is_not_nil(), cpp_declarator_convertert::is_typedef, symbolt::location, exprt::move_to_operands(), exprt::op0(), exprt::op1(), exprt::operands(), exprt::reserve_operands(), messaget::mstreamt::source_location, irept::swap(), to_cpp_declaration(), symbolt::type, exprt::type(), typecheck_type(), and symbolt::value.
Referenced by typecheck_compound_body(), and typecheck_switch().
|
protected |
Definition at line 21 of file cpp_typecheck_enum_type.cpp.
References irept::add(), symbolt::base_name, cpp_scopes, messaget::eom(), messaget::error(), exprt::find_source_location(), Forall_irep, from_integer(), irept::get_sub(), id2string(), cpp_idt::id_class, implicit_typecast(), symbolt::is_macro, symbolt::is_type, symbolt::location, c_typecheck_baset::make_constant(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_scopest::put_into_scope(), messaget::mstreamt::source_location, typet::subtype(), cpp_idt::SYMBOL, c_typecheck_baset::symbol_table, to_c_enum_type(), to_integer(), symbolt::type, exprt::type(), typecheck_expr(), and symbolt::value.
Referenced by typecheck_compound_body(), and typecheck_enum_type().
|
protected |
Definition at line 84 of file cpp_typecheck_enum_type.cpp.
References symbolt::base_name, cpp_idt::CLASS, cpp_scopes, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), cpp_enum_typet::generate_anon_tag(), cpp_namet::get_base_name(), cpp_enum_typet::get_tag_only_declaration(), cpp_enum_typet::has_body(), cpp_enum_typet::has_tag(), irept::id(), id2string(), cpp_idt::id_class, symbolt::is_macro, irept::is_nil(), cpp_namet::is_simple_name(), symbolt::is_type, symbolt::location, irept::make_nil(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_idt::prefix, symbolt::pretty_name, cpp_scopest::put_into_scope(), c_qualifierst::read(), signed_int_type(), typet::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, cpp_enum_typet::tag(), tag_scope(), to_cpp_enum_type(), symbolt::type, typecheck_enum_body(), typecheck_type(), symbolt::value, and c_qualifierst::write().
Referenced by add_method_body(), and typecheck_type().
|
virtual |
Reimplemented from c_typecheck_baset.
Definition at line 2698 of file cpp_typecheck_expr.cpp.
References explicit_typecast_ambiguity(), irept::get_bool(), irept::id(), irept::set(), exprt::type(), c_typecheck_baset::typecheck_expr(), and typecheck_expr_cpp_name().
Referenced by convert(), convert_initializer(), cpp_constructor(), operator_is_overloaded(), resolve(), typecheck_assign(), typecheck_enum_body(), typecheck_expr_new(), typecheck_function_expr(), typecheck_member_initializer(), typecheck_side_effect_function_call(), typecheck_template_args(), typecheck_type(), and zero_initializer().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 702 of file cpp_typecheck_expr.cpp.
References irept::add(), cpp_symbol_expr(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::get(), irept::get_bool(), irept::id(), is_reference(), namespacet::lookup(), exprt::op0(), exprt::operands(), code_typet::parameters(), pointer_type(), reference_type(), irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), to_code_type(), exprt::type(), and c_typecheck_baset::typecheck_expr_address_of().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2775 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::id(), exprt::op0(), exprt::op1(), exprt::operands(), messaget::mstreamt::source_location, and c_typecheck_baset::typecheck_expr_binary_arithmetic().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2796 of file cpp_typecheck_expr.cpp.
References messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), exprt::op0(), exprt::operands(), messaget::mstreamt::source_location, exprt::type(), and c_typecheck_baset::typecheck_expr_comma().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 1400 of file cpp_typecheck_expr.cpp.
References irept::add(), add_implicit_dereference(), typet::add_source_location(), exprt::add_source_location(), c_bool_type(), cpp_scopes, cpp_type2name(), cpp_scopest::current_scope(), messaget::eom(), messaget::error(), irept::get(), irept::get_sub(), irept::id(), irept::is_nil(), code_typet::make_ellipsis(), exprt::op0(), cpp_typecheck_fargst::operands, exprt::operands(), code_typet::parameters(), resolve(), messaget::result(), code_typet::return_type(), irept::set(), symbol_exprt::set_identifier(), signed_int_type(), cpp_namet::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), cpp_idt::this_expr, to_cpp_name(), exprt::type(), typecheck_expr_function_identifier(), typecheck_expr_ptrmember(), typecheck_type(), and cpp_typecheck_resolvet::VAR.
Referenced by typecheck_compound_body(), typecheck_expr(), typecheck_expr_main(), and typecheck_function_expr().
|
protected |
Definition at line 1006 of file cpp_typecheck_expr.cpp.
References exprt::add_source_location(), already_typechecked(), cpp_destructor(), messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), irept::get(), irept::id(), irept::is_not_nil(), exprt::op0(), exprt::operands(), pointer_type(), irept::remove(), irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), to_string(), exprt::type(), and typecheck_code().
Referenced by typecheck_compound_body(), and typecheck_expr_side_effect().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2588 of file cpp_typecheck_expr.cpp.
References messaget::eom(), messaget::error(), irept::find(), exprt::find_source_location(), namespace_baset::follow(), irept::id(), irept::is_not_nil(), exprt::op0(), exprt::operands(), messaget::mstreamt::source_location, exprt::type(), and c_typecheck_baset::typecheck_expr_dereference().
Referenced by typecheck_compound_body(), and typecheck_expr_ptrmember().
|
protected |
Definition at line 965 of file cpp_typecheck_expr.cpp.
References cpp_is_pod(), irept::get(), irept::id(), new_temporary(), exprt::operands(), exprt::source_location(), exprt::type(), typecheck_expr_main(), and typecheck_type().
Referenced by typecheck_compound_body(), and typecheck_expr_main().
|
protected |
Definition at line 879 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), collect_comma_expression(), const_typecast(), messaget::eom(), messaget::error(), exprt::find_source_location(), side_effect_expr_function_callt::function(), messaget::get_message_handler(), irept::id(), exprt::op0(), exprt::operands(), reinterpret_typecast(), resolve(), exprt::source_location(), messaget::mstreamt::source_location, static_typecast(), irept::swap(), to_cpp_name(), to_string(), cpp_typecheck_resolvet::TYPE, exprt::type(), typecheck_side_effect_function_call(), typecheck_type(), and zero_initializer().
Referenced by typecheck_compound_body(), typecheck_expr_main(), and typecheck_side_effect_function_call().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2679 of file cpp_typecheck_expr.cpp.
References irept::get(), irept::id(), irept::set(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, c_typecheck_baset::typecheck_expr_function_identifier(), and symbolt::value.
Referenced by typecheck_compound_body(), and typecheck_expr_cpp_name().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2791 of file cpp_typecheck_expr.cpp.
References c_typecheck_baset::typecheck_expr_index().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Called after the operands are done.
Reimplemented from c_typecheck_baset.
Definition at line 52 of file cpp_typecheck_expr.cpp.
References convert_pmop(), irept::find(), namespace_baset::follow(), namespace_baset::follow_symbol(), irept::get(), class_typet::has_base(), irept::id(), irept::is_nil(), operator_is_overloaded(), irept::pretty(), irept::set(), to_class_type(), exprt::type(), typecheck_expr_cpp_name(), typecheck_expr_explicit_constructor_call(), typecheck_expr_explicit_typecast(), c_typecheck_baset::typecheck_expr_main(), typecheck_expr_this(), and typecheck_type().
Referenced by convert_pmop(), typecheck_compound_body(), and typecheck_expr_explicit_constructor_call().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 301 of file cpp_typecheck_expr.cpp.
Referenced by cpp_typecheck_resolvet::convert_identifier(), typecheck_compound_body(), typecheck_expr_ptrmember(), and typecheck_function_expr().
|
protected |
Definition at line 1072 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), cpp_typecheck_fargst::add_object(), exprt::add_source_location(), cpp_scopes, elaborate_class_template(), messaget::eom(), messaget::error(), irept::find(), exprt::find_source_location(), namespace_baset::follow(), irept::get(), irept::get_bool(), struct_union_typet::get_component(), get_component(), irept::id(), irept::is_nil(), irept::is_not_nil(), namespacet::lookup(), irept::make_nil(), exprt::op0(), exprt::operands(), irept::remove(), resolve(), irept::set(), cpp_scopest::set_scope(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, to_cpp_name(), to_string(), to_struct_union_type(), to_symbol_expr(), exprt::type(), symbolt::value, and cpp_typecheck_resolvet::VAR.
|
protected |
Definition at line 787 of file cpp_typecheck_expr.cpp.
References irept::add(), configt::ansi_c, c_sizeof(), config, cpp_constructor(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::get(), irept::id(), implicit_typecast(), configt::ansi_ct::int_width, exprt::move_to_operands(), exprt::op0(), exprt::operands(), pointer_type(), irept::set(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), to_array_type(), exprt::type(), typecheck_expr(), and typecheck_type().
Referenced by typecheck_compound_body(), and typecheck_expr_side_effect().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 363 of file cpp_typecheck_expr.cpp.
Referenced by typecheck_compound_body(), typecheck_expr_cpp_name(), and typecheck_function_expr().
|
protected |
Definition at line 1253 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), exprt::add_source_location(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::id(), exprt::move_to_operands(), exprt::op0(), exprt::operands(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), to_string(), exprt::type(), typecheck_expr_dereference(), and typecheck_expr_member().
|
protected |
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2813 of file cpp_typecheck_expr.cpp.
References c_typecheck_baset::typecheck_expr_rel().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2331 of file cpp_typecheck_expr.cpp.
References irept::get(), typecheck_expr_delete(), typecheck_expr_new(), c_typecheck_baset::typecheck_expr_side_effect(), typecheck_expr_throw(), and typecheck_side_effect_inc_dec().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 308 of file cpp_typecheck_expr.cpp.
References cpp_typecheck_resolvet::BOTH, exprt::copy_to_operands(), irept::find(), irept::id(), exprt::operands(), irept::remove(), resolve(), typet::subtype(), to_array_type(), to_cpp_name(), and c_typecheck_baset::typecheck_expr_sizeof().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 987 of file cpp_typecheck_expr.cpp.
References exprt::add_source_location(), cpp_idt::class_identifier, cpp_scopes, cpp_scopest::current_scope(), dstringt::empty(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::id(), irept::is_not_nil(), messaget::mstreamt::source_location, cpp_idt::this_expr, and exprt::type().
Referenced by typecheck_compound_body(), and typecheck_expr_main().
|
protected |
Definition at line 761 of file cpp_typecheck_expr.cpp.
References cpp_exception_list(), messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), exprt::op0(), exprt::operands(), irept::set(), messaget::mstreamt::source_location, and exprt::type().
Referenced by typecheck_compound_body(), and typecheck_expr_side_effect().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 140 of file cpp_typecheck_expr.cpp.
References index_exprt::array(), messaget::eom(), messaget::error(), exprt::find_source_location(), from_integer(), irept::get(), irept::get_bool(), irept::id(), implicit_conversion_sequence(), implicit_typecast(), index_exprt::index(), index_type(), c_qualifierst::is_subset_of(), exprt::op0(), exprt::op1(), exprt::op2(), exprt::operands(), c_qualifierst::read(), irept::set(), messaget::mstreamt::source_location, standard_conversion_array_to_pointer(), standard_conversion_function_to_pointer(), standard_conversion_lvalue_to_rvalue(), typet::subtype(), irept::swap(), exprt::type(), and type2cpp().
Referenced by typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 1063 of file cpp_typecheck_expr.cpp.
References irept::pretty().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 843 of file cpp_typecheck_compound_type.cpp.
References irept::add(), cpp_declarator_convertert::convert(), cpp_scopes, cpp_symbol_expr(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), irept::find(), cpp_scopest::go_to_global_scope(), irept::id(), cpp_declarator_convertert::is_friend, irept::is_not_nil(), cpp_declarationt::is_template(), cpp_declarationt::member_spec(), irept::move_to_sub(), cpp_member_spect::set_inline(), typet::source_location(), messaget::mstreamt::source_location, cpp_declarationt::storage_spec(), symbolt::type, and exprt::type().
Referenced by add_method_body(), and typecheck_compound_body().
|
protectedvirtual |
type:checked | arguments, type-checked function |
Reimplemented from c_typecheck_baset.
Definition at line 2278 of file cpp_typecheck_expr.cpp.
References side_effect_expr_function_callt::arguments(), exprt::copy_to_operands(), side_effect_expr_function_callt::function(), is_reference(), new_temporary(), code_typet::parameters(), to_code_type(), exprt::type(), and c_typecheck_baset::typecheck_function_call_arguments().
Referenced by typecheck_compound_body(), typecheck_member_initializer(), and typecheck_side_effect_function_call().
|
protected |
Definition at line 368 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), exprt::copy_to_operands(), side_effect_expr_function_callt::function(), irept::get_sub(), irept::id(), exprt::op0(), exprt::operands(), exprt::source_location(), irept::swap(), exprt::type(), typecheck_expr(), typecheck_expr_cpp_name(), typecheck_expr_member(), c_typecheck_baset::typecheck_expr_operands(), typecheck_expr_ptrmember(), and typecheck_side_effect_function_call().
Referenced by typecheck_compound_body(), and typecheck_side_effect_function_call().
|
protected |
typecheck function templates
Definition at line 208 of file cpp_typecheck_template.cpp.
References symbolt::base_name, cpp_convert_plain_type(), cpp_scopes, cpp_scopest::current_scope(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), irept::find(), function_template_identifier(), cpp_namet::get_base_name(), id2string(), cpp_idt::id_class, cpp_scopest::id_map, irept::is_not_nil(), cpp_namet::is_simple_name(), symbolt::location, irept::make_nil(), symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), symbolt::name, cpp_idt::prefix, symbolt::pretty_name, cpp_scopest::put_into_scope(), cpp_namet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, cpp_idt::TEMPLATE, cpp_idt::TEMPLATE_SCOPE, cpp_declarationt::template_type(), to_cpp_declaration(), to_cpp_name(), symbolt::type, exprt::type(), typecheck_template_parameters(), and symbolt::value.
Referenced by convert_template_declaration().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 114 of file cpp_typecheck_code.cpp.
References code_ifthenelset::cond(), irept::id(), to_code(), typecheck_code(), and c_typecheck_baset::typecheck_ifthenelse().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 1251 of file cpp_typecheck_compound_type.cpp.
References add_method_body(), add_this_to_method_type(), symbolt::base_name, cpp_scopes, cpp_scopest::current_scope(), dstringt::empty(), messaget::eom(), messaget::error(), function_identifier(), struct_union_typet::componentt::get_base_name(), irept::get_bool(), cpp_scopet::get_parent(), irept::id(), id2string(), symbolt::is_macro, irept::is_not_nil(), cpp_scopet::is_template_scope(), symbolt::is_type, symbolt::location, symbolt::mode, symbolt::module, c_typecheck_baset::module, symbol_tablet::move(), move_member_initializers(), symbolt::name, exprt::op0(), cpp_idt::prefix, irept::set(), struct_union_typet::componentt::set_name(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), c_typecheck_baset::symbol_table, symbolt::type, exprt::type(), and symbolt::value.
Referenced by typecheck_compound_body(), and typecheck_compound_declarator().
|
protectedvirtual |
Definition at line 173 of file cpp_typecheck_code.cpp.
References cpp_typecheck_fargst::add_object(), exprt::add_source_location(), already_typechecked(), cpp_idt::class_identifier, exprt::copy_to_operands(), cpp_constructor(), cpp_scopes, cpp_scopest::current_scope(), dereference(), messaget::eom(), messaget::error(), code_expressiont::expression(), irept::find(), exprt::find_source_location(), forall_operands, Forall_operands, side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), cpp_scopest::go_to(), irept::id(), cpp_scopest::id_map, cpp_typecheck_fargst::in_use, irept::is_nil(), irept::is_not_nil(), is_reference(), irept::make_nil(), make_ptr_typecast(), exprt::op0(), cpp_typecheck_fargst::operands, exprt::operands(), code_typet::parameters(), reference_initializer(), irept::remove(), resolve(), irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), cpp_idt::this_expr, to_code_type(), to_cpp_name(), to_string(), exprt::type(), typecheck_expr(), typecheck_function_call_arguments(), typecheck_side_effect_assignment(), and cpp_typecheck_resolvet::VAR.
Referenced by typecheck_code(), and typecheck_compound_body().
|
protected |
Definition at line 2365 of file cpp_typecheck_expr.cpp.
References add_method_body(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), base_type_eq(), cpp_symbol_expr(), side_effect_expr_function_callt::function(), irept::get_bool(), irept::id(), implicit_typecast(), is_reference(), namespacet::lookup(), symbolt::name, exprt::op0(), exprt::operands(), code_typet::parameters(), irept::remove(), irept::set(), irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, to_code_type(), symbolt::type, exprt::type(), and symbolt::value.
Referenced by typecheck_compound_body(), and typecheck_side_effect_function_call().
|
protected |
Definition at line 14 of file cpp_typecheck_method_bodies.cpp.
References c_typecheck_baset::add_argc_argv(), convert_function(), irept::id(), instantiation_stack, irept::is_not_nil(), exprt::is_zero(), symbolt::name, template_mapt::swap(), template_map, and symbolt::value.
Referenced by convert(), and typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 2425 of file cpp_typecheck_expr.cpp.
References exprt::add_source_location(), already_typechecked(), side_effect_expr_function_callt::arguments(), cpp_is_pod(), messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), side_effect_expr_function_callt::function(), irept::get(), irept::get_sub(), is_reference(), exprt::move_to_operands(), exprt::op0(), exprt::op1(), exprt::operands(), irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), exprt::type(), c_typecheck_baset::typecheck_side_effect_assignment(), and typecheck_side_effect_function_call().
Referenced by cpp_constructor(), typecheck_compound_body(), and typecheck_member_initializer().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 1914 of file cpp_typecheck_expr.cpp.
References irept::add(), add_implicit_dereference(), add_method_body(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), struct_union_typet::components(), exprt::copy_to_operands(), cpp_is_pod(), c_typecheck_baset::do_special_functions(), messaget::eom(), messaget::error(), irept::find(), exprt::find_source_location(), namespace_baset::follow(), namespace_baset::follow_symbol(), side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), struct_union_typet::get_component(), get_component(), irept::get_string(), irept::get_sub(), irept::id(), irept::is_nil(), irept::is_not_nil(), cpp_namet::is_qualified(), exprt::move_to_operands(), exprt::op0(), exprt::op1(), exprt::operands(), pointer_type(), irept::remove(), c_typecheck_baset::return_type, irept::set(), exprt::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), c_typecheck_baset::symbol_table, symbol_tablet::symbols, to_code_type(), to_cpp_name(), to_string(), to_struct_type(), exprt::type(), typecheck_cast_expr(), typecheck_expr(), typecheck_expr_explicit_typecast(), typecheck_function_call_arguments(), typecheck_function_expr(), and typecheck_method_application().
Referenced by cpp_constructor(), cpp_destructor(), operator_is_overloaded(), reference_binding(), typecheck_compound_body(), typecheck_expr_explicit_typecast(), typecheck_function_expr(), typecheck_side_effect_assignment(), typecheck_side_effect_inc_dec(), and user_defined_conversion_sequence().
|
protected |
Definition at line 2512 of file cpp_typecheck_expr.cpp.
References add_implicit_dereference(), exprt::add_source_location(), already_typechecked(), side_effect_expr_function_callt::arguments(), messaget::eom(), messaget::error(), exprt::find_source_location(), namespace_baset::follow(), from_integer(), side_effect_expr_function_callt::function(), irept::get(), side_effect_exprt::get_statement(), irept::get_sub(), is_number(), exprt::move_to_operands(), exprt::op0(), exprt::operands(), irept::set(), signed_int_type(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), exprt::type(), c_typecheck_baset::typecheck_expr_side_effect(), and typecheck_side_effect_function_call().
Referenced by typecheck_compound_body(), and typecheck_expr_side_effect().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 142 of file cpp_typecheck_code.cpp.
References codet::get_statement(), irept::id(), exprt::move_to_operands(), exprt::op0(), exprt::operands(), irept::swap(), to_code(), typecheck_decl(), c_typecheck_baset::typecheck_switch(), and code_switcht::value().
Referenced by typecheck_compound_body().
|
protected |
Definition at line 854 of file cpp_typecheck_template.cpp.
References cpp_template_args_baset::arguments(), cpp_scopes, template_parametert::default_argument(), messaget::eom(), messaget::error(), irept::get_bool(), cpp_scopest::go_to(), template_parametert::has_default_argument(), irept::id(), cpp_scopest::id_map, implicit_typecast(), INVARIANT_STRUCTURED, symbolt::name, messaget::result(), template_mapt::set(), simplify(), messaget::mstreamt::source_location, template_mapt::swap(), irept::swap(), template_map, cpp_declarationt::template_type(), to_cpp_declaration(), symbolt::type, exprt::type(), typecheck_expr(), and typecheck_type().
Referenced by cpp_typecheck_resolvet::apply_template_args(), convert_class_template_specialization(), convert_template_function_or_member_specialization(), and cpp_typecheck_resolvet::disambiguate_template_classes().
|
protected |
Definition at line 721 of file cpp_typecheck_template.cpp.
References irept::add(), typet::add_source_location(), exprt::add_source_location(), cpp_declarator_convertert::convert(), cpp_scopes, cpp_scopest::current_scope(), cpp_declarationt::declarators(), messaget::eom(), messaget::error(), exprt::find_source_location(), irept::get_bool(), cpp_scopet::get_parent(), cpp_scopest::go_to(), irept::id(), id2string(), cpp_idt::id_class, cpp_idt::identifier, cpp_scopet::insert(), irept::is_not_nil(), cpp_declarator_convertert::is_template_parameter, cpp_declarator_convertert::is_typedef, irept::make_nil(), symbolt::name, cpp_scopet::new_scope(), cpp_idt::prefix, irept::set(), exprt::source_location(), messaget::mstreamt::source_location, irept::swap(), symbolt::symbol_expr(), template_counter, cpp_idt::TEMPLATE_PARAMETER, template_typet::template_parameters(), cpp_idt::TEMPLATE_SCOPE, and exprt::type().
Referenced by add_method_body(), instantiate_template(), typecheck_class_template(), typecheck_class_template_member(), and typecheck_function_template().
|
protectedvirtual |
Definition at line 48 of file cpp_typecheck_code.cpp.
References cpp_exception_id(), is_reference(), exprt::op0(), exprt::operands(), irept::set(), typet::subtype(), code_declt::symbol(), to_code(), to_code_block(), to_code_decl(), to_cpp_declaration(), exprt::type(), and typecheck_code().
Referenced by typecheck_code(), and typecheck_compound_body().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 23 of file cpp_typecheck_type.cpp.
References irept::add(), cpp_typecheck_resolvet::BOTH, cpp_convert_plain_type(), dstringt::empty(), messaget::eom(), messaget::error(), irept::find(), irept::get_bool(), irept::get_sub(), irept::id(), implicit_typecast(), c_qualifierst::is_constant, irept::is_nil(), irept::is_not_nil(), code_typet::parameters(), pointer_type(), irept::pretty(), resolve(), code_typet::return_type(), irept::set(), simplify(), array_typet::size(), typet::source_location(), messaget::mstreamt::source_location, typet::subtype(), irept::swap(), to_array_type(), to_c_bit_field_type(), to_code_type(), to_cpp_name(), to_struct_union_type(), cpp_typecheck_resolvet::TYPE, exprt::type(), c_typecheck_baset::typecheck_c_bit_field_type(), typecheck_compound_type(), typecheck_enum_type(), typecheck_expr(), and c_qualifierst::write().
Referenced by add_method_body(), check_member_initializers(), cpp_declarator_convertert::convert(), convert_initializer(), convert_non_template_declaration(), full_member_initialization(), cpp_typecheck_resolvet::guess_function_template_args(), operator_is_overloaded(), cpp_typecheck_resolvet::resolve_scope(), typecheck_cast_expr(), typecheck_compound_body(), typecheck_compound_declarator(), typecheck_decl(), typecheck_enum_type(), typecheck_expr_cpp_name(), typecheck_expr_explicit_constructor_call(), typecheck_expr_explicit_typecast(), typecheck_expr_main(), typecheck_expr_new(), and typecheck_template_args().
|
protectedvirtual |
Reimplemented from c_typecheck_baset.
Definition at line 128 of file cpp_typecheck_code.cpp.
References code_whilet::cond(), irept::id(), to_code(), typecheck_code(), and c_typecheck_baset::typecheck_while().
Referenced by typecheck_compound_body().
bool cpp_typecheckt::user_defined_conversion_sequence | ( | const exprt & | expr, |
const typet & | type, | ||
exprt & | new_expr, | ||
unsigned & | rank | ||
) |
User-defined conversion sequence.
Definition at line 842 of file cpp_typecheck_conversions.cpp.
References irept::add(), exprt::add_source_location(), side_effect_expr_function_callt::arguments(), struct_union_typet::components(), exprt::copy_to_operands(), cpp_is_pod(), cpp_symbol_expr(), irept::find(), namespace_baset::follow(), side_effect_expr_function_callt::function(), irept::get(), irept::get_bool(), irept::get_sub(), irept::id(), implicit_conversion_sequence(), INVARIANT, irept::is_nil(), irept::is_not_nil(), is_reference(), namespacet::lookup(), irept::make_nil(), make_ptr_typecast(), exprt::op0(), pointer_type(), c_qualifierst::read(), irept::set(), exprt::source_location(), standard_conversion_sequence(), typet::subtype(), subtype_typecast(), irept::swap(), to_struct_type(), exprt::type(), typecheck_side_effect_function_call(), and c_qualifierst::write().
Referenced by implicit_conversion_sequence(), reference_binding(), and typecheck_compound_body().
|
protected |
Definition at line 175 of file cpp_typecheck_initializer.cpp.
References irept::add(), exprt::add_source_location(), already_typechecked(), c_sizeof(), exprt::copy_to_operands(), cpp_is_pod(), messaget::eom(), messaget::error(), irept::find(), namespace_baset::follow(), forall_irep, from_integer(), irept::get(), irept::get_bool(), messaget::get_message_handler(), irept::get_sub(), irept::id(), index_type(), irept::is_not_nil(), code_assignt::lhs(), exprt::make_typecast(), irept::move_to_sub(), exprt::op0(), code_assignt::rhs(), irept::set(), array_typet::size(), messaget::mstreamt::source_location, typet::subtype(), to_array_type(), to_integer(), exprt::type(), typecheck_code(), and typecheck_expr().
Referenced by typecheck_compound_body(), and typecheck_expr_explicit_typecast().
|
friend |
Definition at line 85 of file cpp_typecheck.h.
|
friend |
Definition at line 84 of file cpp_typecheck.h.
|
protected |
Definition at line 227 of file cpp_typecheck.h.
Referenced by convert_anonymous_union(), convert_parameter(), and typecheck_compound_type().
|
protected |
Definition at line 110 of file cpp_typecheck.h.
Referenced by cpp_typecheck(), and typecheck().
|
protected |
Definition at line 108 of file cpp_typecheck.h.
Referenced by add_anonymous_members_to_scope(), cpp_typecheck_resolvet::apply_template_args(), check_component_access(), class_template_identifier(), class_template_symbol(), cpp_declarator_convertert::convert(), convert(), convert_anon_struct_union_member(), convert_anonymous_union(), convert_class_template_specialization(), convert_function(), cpp_typecheck_resolvet::convert_identifier(), cpp_declarator_convertert::convert_new_symbol(), convert_parameter(), convert_template_function_or_member_specialization(), cpp_constructor(), cpp_destructor(), cpp_typecheck_resolvet::disambiguate_template_classes(), cpp_typecheck_resolvet::do_builtin(), cpp_typecheck_resolvet::filter_for_named_scopes(), cpp_typecheck_resolvet::guess_function_template_args(), cpp_typecheck_resolvet::guess_template_args(), instantiate_template(), operator_is_overloaded(), put_compound_into_scope(), cpp_typecheck_resolvet::resolve(), cpp_typecheck_resolvet::resolve_namespace(), cpp_typecheck_resolvet::resolve_scope(), cpp_typecheck_resolvet::resolve_with_arguments(), tag_scope(), this_struct_type(), typecheck_block(), typecheck_class_template(), typecheck_class_template_member(), typecheck_compound_bases(), typecheck_compound_body(), typecheck_compound_declarator(), typecheck_compound_type(), typecheck_enum_body(), typecheck_enum_type(), typecheck_expr_cpp_name(), typecheck_expr_member(), typecheck_expr_this(), typecheck_friend_declaration(), typecheck_function_template(), typecheck_member_function(), typecheck_member_initializer(), typecheck_template_args(), and typecheck_template_parameters().
|
protected |
Definition at line 111 of file cpp_typecheck.h.
Referenced by convert(), and typecheck().
|
private |
Definition at line 596 of file cpp_typecheck.h.
Referenced by cpp_typecheck_resolvet::convert_identifier(), get_component(), and static_and_dynamic_initialization().
|
private |
Definition at line 595 of file cpp_typecheck.h.
Referenced by cpp_declarator_convertert::convert_new_symbol(), static_and_dynamic_initialization(), and typecheck_compound_declarator().
|
protected |
Definition at line 183 of file cpp_typecheck.h.
Referenced by instantiate_template(), cpp_typecheck_resolvet::resolve(), show_instantiation_stack(), and typecheck_method_bodies().
|
protected |
Definition at line 341 of file cpp_typecheck.h.
Referenced by convert().
|
protected |
Definition at line 226 of file cpp_typecheck.h.
Referenced by typecheck_template_parameters().
|
protected |
Definition at line 229 of file cpp_typecheck.h.
Referenced by cpp_typecheck_resolvet::convert_template_parameter(), cpp_typecheck_resolvet::disambiguate_template_classes(), cpp_typecheck_resolvet::filter_for_named_scopes(), cpp_typecheck_resolvet::guess_function_template_args(), cpp_typecheck_resolvet::guess_template_args(), instantiate_template(), typecheck_class_template_member(), typecheck_method_bodies(), and typecheck_template_args().