CBMC
cpp_typecheckt Class Reference

#include <cpp_typecheck.h>

+ Inheritance diagram for cpp_typecheckt:
+ Collaboration diagram for cpp_typecheckt:

Classes

class  instantiation_levelt
 
class  instantiationt
 
struct  method_bodyt
 

Public Member Functions

 cpp_typecheckt (cpp_parse_treet &_cpp_parse_tree, symbol_table_baset &_symbol_table, const std::string &_module, message_handlert &message_handler)
 
 cpp_typecheckt (cpp_parse_treet &_cpp_parse_tree, symbol_table_baset &_symbol_table1, const symbol_table_baset &_symbol_table2, const std::string &_module, message_handlert &message_handler)
 
 ~cpp_typecheckt () override
 
void typecheck () override
 typechecking main method More...
 
std::string to_string (const typet &) override
 
std::string to_string (const exprt &) override
 
exprt resolve (const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
 
void typecheck_expr (exprt &) override
 
bool cpp_is_pod (const typet &type) const
 
std::optional< codetcpp_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 reference_typet &type) const
 Reference-related. More...
 
bool reference_compatible (const exprt &expr, const reference_typet &type, unsigned &rank) const
 Reference-compatible. More...
 
bool reference_binding (exprt expr, const reference_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 reference_typet &type)
 A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows: More...
 
void implicit_typecast (exprt &expr, const typet &type) override
 
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 pointer_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)
 
bool contains_cpp_name (const exprt &)
 
- Public Member Functions inherited from c_typecheck_baset
 c_typecheck_baset (symbol_table_baset &_symbol_table, const std::string &_module, message_handlert &_message_handler)
 
 c_typecheck_baset (symbol_table_baset &_symbol_table1, const symbol_table_baset &_symbol_table2, const std::string &_module, message_handlert &_message_handler)
 
virtual ~c_typecheck_baset ()
 
virtual void typecheck_spec_assigns (exprt::operandst &targets)
 
- Public Member Functions inherited from typecheckt
 typecheckt (message_handlert &_message_handler)
 
virtual ~typecheckt ()
 
virtual bool typecheck_main ()
 
- Public Member Functions inherited from messaget
virtual void set_message_handler (message_handlert &_message_handler)
 
message_handlertget_message_handler ()
 
 messaget (const messaget &other)
 
messagetoperator= (const messaget &other)
 
 messaget (message_handlert &_message_handler)
 
virtual ~messaget ()
 
mstreamtget_mstream (unsigned message_level) const
 
mstreamterror () const
 
mstreamtwarning () const
 
mstreamtresult () const
 
mstreamtstatus () const
 
mstreamtstatistics () const
 
mstreamtprogress () const
 
mstreamtdebug () const
 
void conditional_output (mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
 Generate output to message_stream using output_generator if the configured verbosity is at least as high as that of message_stream. More...
 
- Public Member Functions inherited from namespacet
 namespacet (const symbol_table_baset &_symbol_table)
 
 namespacet (const symbol_table_baset &_symbol_table1, const symbol_table_baset &_symbol_table2)
 
 namespacet (const symbol_table_baset *_symbol_table1, const symbol_table_baset *_symbol_table2)
 
bool lookup (const irep_idt &name, const symbolt *&symbol) const override
 See documentation for namespace_baset::lookup(). More...
 
std::size_t smallest_unused_suffix (const std::string &prefix) const override
 See documentation for namespace_baset::smallest_unused_suffix(). More...
 
const symbol_table_basetget_symbol_table () const
 Return first symbol table registered with the namespace. More...
 
const symboltlookup (const irep_idt &name) const
 Lookup a symbol in the namespace. More...
 
const symboltlookup (const symbol_exprt &) const
 Generic lookup function for a symbol expression in a symbol table. More...
 
const symboltlookup (const tag_typet &) const
 Generic lookup function for a tag type in a symbol table. More...
 
virtual bool lookup (const irep_idt &name, const symbolt *&symbol) const=0
 Searches for a symbol named name. More...
 
- Public Member Functions inherited from namespace_baset
const symboltlookup (const irep_idt &name) const
 Lookup a symbol in the namespace. More...
 
const symboltlookup (const symbol_exprt &) const
 Generic lookup function for a symbol expression in a symbol table. More...
 
const symboltlookup (const tag_typet &) const
 Generic lookup function for a tag type in a symbol table. More...
 
virtual ~namespace_baset ()
 
void follow_macros (exprt &) const
 Follow macros to their values in a given expression. More...
 
const typetfollow (const typet &) const
 Resolve type symbol to the type it points to. More...
 
const union_typetfollow_tag (const union_tag_typet &) const
 Follow type tag of union type. More...
 
const struct_typetfollow_tag (const struct_tag_typet &) const
 Follow type tag of struct type. More...
 
const c_enum_typetfollow_tag (const c_enum_tag_typet &) const
 Follow type tag of enum type. More...
 
const struct_union_typetfollow_tag (const struct_or_union_tag_typet &) const
 Resolve a struct_tag_typet or union_tag_typet to the complete version. More...
 

Protected Types

typedef std::list< instantiationtinstantiation_stackt
 
typedef std::list< method_bodytmethod_bodiest
 
- Protected Types inherited from c_typecheck_baset
typedef std::unordered_map< irep_idt, typetid_type_mapt
 
typedef std::unordered_map< irep_idt, irep_idtasm_label_mapt
 

Protected Member Functions

void convert (cpp_linkage_spect &)
 
void convert (cpp_namespace_spect &)
 
void convert (cpp_usingt &)
 
void convert (cpp_itemt &)
 
void convert (cpp_declarationt &)
 
void convert (cpp_declaratort &)
 
void convert (cpp_static_assertt &)
 
void convert_initializer (symbolt &symbol)
 Initialize an object with a value. More...
 
void convert_function (symbolt &symbol)
 
void convert_pmop (exprt &expr)
 
codet convert_anonymous_union (cpp_declarationt &declaration)
 
void convert_anon_struct_union_member (const cpp_declarationt &declaration, const irep_idt &access, struct_typet::componentst &components)
 
void salvage_default_arguments (const template_typet &old_type, template_typet &new_type)
 
void convert_template_declaration (cpp_declarationt &declaration)
 
void convert_non_template_declaration (cpp_declarationt &declaration)
 
void convert_template_function_or_member_specialization (cpp_declarationt &declaration)
 
void convert_class_template_specialization (cpp_declarationt &declaration)
 
void typecheck_class_template (cpp_declarationt &declaration)
 
void typecheck_function_template (cpp_declarationt &declaration)
 typecheck function templates More...
 
void typecheck_class_template_member (cpp_declarationt &declaration)
 typecheck class template members; these can be methods or static members More...
 
std::string class_template_identifier (const irep_idt &base_name, const template_typet &template_type, const cpp_template_args_non_tct &partial_specialization_args)
 
std::string function_template_identifier (const irep_idt &base_name, const template_typet &template_type, const typet &function_type)
 
cpp_template_args_tct typecheck_template_args (const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_non_tct &template_args)
 
void show_instantiation_stack (std::ostream &)
 
const symboltclass_template_symbol (const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args)
 
void elaborate_class_template (const typet &type)
 elaborate class template instances More...
 
const symboltinstantiate_template (const source_locationt &source_location, const symbolt &symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args, const typet &specialization=uninitialized_typet{})
 
void elaborate_class_template (const source_locationt &source_location, const struct_tag_typet &type)
 
std::string template_suffix (const cpp_template_args_tct &template_args)
 
cpp_scopetsub_scope_for_instantiation (cpp_scopet &template_scope, const std::string &suffix)
 Set up a scope as subscope of the template scope. More...
 
void convert_parameters (const irep_idt &current_mode, code_typet &function_type)
 
void convert_parameter (const irep_idt &current_mode, code_typet::parametert &parameter)
 
void default_ctor (const source_locationt &source_location, const irep_idt &base_name, cpp_declarationt &ctor) const
 Generate code for implicit default constructors. More...
 
void default_cpctor (const symbolt &, cpp_declarationt &cpctor) const
 Generate code for implicit default copy constructor. More...
 
void default_assignop (const symbolt &symbol, cpp_declarationt &cpctor)
 Generate declaration of the implicit default assignment operator. More...
 
void default_assignop_value (const symbolt &symbol, cpp_declaratort &declarator)
 Generate code for the implicit default assignment operator. More...
 
void default_dtor (const symbolt &symb, cpp_declarationt &dtor)
 Note: More...
 
codet dtor (const symbolt &symb, const symbol_exprt &this_expr)
 produces destructor code for a class object More...
 
void check_member_initializers (const struct_typet::basest &bases, const struct_typet::componentst &components, const irept &initializers)
 Check a constructor initialization-list. More...
 
bool check_component_access (const struct_union_typet::componentt &component, const struct_union_typet &struct_union_type)
 
void full_member_initialization (const struct_union_typet &struct_union_type, irept &initializers)
 Build the full initialization list of the constructor. More...
 
bool find_cpctor (const symbolt &symbol) const
 
bool find_assignop (const symbolt &symbol) const
 
bool find_dtor (const symbolt &symbol) const
 
bool find_parent (const symbolt &symb, const irep_idt &base_name, irep_idt &identifier)
 
bool get_component (const source_locationt &source_location, const exprt &object, const irep_idt &component_name, exprt &member)
 
void new_temporary (const source_locationt &source_location, const typet &, const exprt::operandst &ops, exprt &temporary)
 
void new_temporary (const source_locationt &source_location, const typet &, const exprt &op, exprt &temporary)
 
void static_and_dynamic_initialization ()
 Initialization of static objects: More...
 
void do_not_typechecked ()
 
void clean_up ()
 
void add_base_components (const struct_typet &from, const irep_idt &access, struct_typet &to, std::set< irep_idt > &bases, std::set< irep_idt > &vbases, bool is_virtual)
 
bool cast_away_constness (const typet &t1, const typet &t2) const
 
void do_virtual_table (const symbolt &symbol)
 
void add_method_body (symbolt *_method_symbol)
 
bool builtin_factory (const irep_idt &) override
 
void typecheck_type (typet &) override
 
cpp_scopettypecheck_template_parameters (template_typet &type)
 
void typecheck_compound_type (struct_union_typet &) override
 
void check_fixed_size_array (typet &type)
 check that an array has fixed size More...
 
void typecheck_enum_type (typet &type)
 
cpp_scopettag_scope (const irep_idt &_base_name, bool has_body, bool tag_only_declaration)
 
void typecheck_compound_declarator (const symbolt &symbol, const cpp_declarationt &declaration, cpp_declaratort &declarator, struct_typet::componentst &components, const irep_idt &access, bool is_static, bool is_typedef, bool is_mutable)
 
void typecheck_friend_declaration (symbolt &symbol, cpp_declarationt &cpp_declaration)
 
void put_compound_into_scope (const struct_union_typet::componentt &component)
 
void typecheck_compound_body (symbolt &symbol)
 
void typecheck_compound_body (struct_union_typet &) override
 
void typecheck_enum_body (symbolt &symbol)
 
void typecheck_method_bodies ()
 
void typecheck_compound_bases (struct_typet &type)
 
void add_anonymous_members_to_scope (const symbolt &struct_union_symbol)
 
void move_member_initializers (irept &initializers, const code_typet &type, exprt &value)
 
void typecheck_member_function (const symbolt &compound_symbol, struct_typet::componentt &component, irept &initializers, const typet &method_qualifier, exprt &value)
 
void add_this_to_method_type (const symbolt &compound_symbol, code_typet &method_type, const typet &method_qualifier)
 
irep_idt function_identifier (const typet &type)
 for function overloading More...
 
void zero_initializer (const exprt &object, const typet &type, const source_locationt &source_location, exprt::operandst &ops)
 
void typecheck_code (codet &) override
 
void typecheck_try_catch (codet &)
 
void typecheck_member_initializer (codet &)
 
void typecheck_decl (codet &) override
 
void typecheck_block (code_blockt &) override
 
void typecheck_ifthenelse (code_ifthenelset &) override
 
void typecheck_while (code_whilet &) override
 
void typecheck_switch (codet &) override
 
const struct_typetthis_struct_type ()
 
std::optional< codetcpp_destructor (const source_locationt &source_location, const exprt &object)
 
void explicit_typecast_ambiguity (exprt &)
 
void typecheck_expr_main (exprt &) override
 Called after the operands are done. More...
 
void typecheck_expr_member (exprt &) override
 
void typecheck_expr_ptrmember (exprt &) override
 
void typecheck_expr_throw (exprt &)
 
void typecheck_function_expr (exprt &, const cpp_typecheck_fargst &)
 
void typecheck_expr_cpp_name (exprt &, const cpp_typecheck_fargst &)
 
void typecheck_expr_member (exprt &, const cpp_typecheck_fargst &)
 
void typecheck_expr_ptrmember (exprt &, const cpp_typecheck_fargst &)
 
void typecheck_cast_expr (exprt &)
 
void typecheck_expr_trinary (if_exprt &) override
 
void typecheck_expr_binary_arithmetic (exprt &) override
 
void typecheck_expr_explicit_typecast (exprt &)
 
void typecheck_expr_explicit_constructor_call (exprt &)
 
void typecheck_expr_address_of (exprt &) override
 
void typecheck_expr_dereference (exprt &) override
 
void typecheck_expr_function_identifier (exprt &) override
 
void typecheck_expr_reference_to (exprt &)
 
void typecheck_expr_this (exprt &)
 
void typecheck_expr_new (exprt &)
 
void typecheck_expr_sizeof (exprt &) override
 
void typecheck_expr_delete (exprt &)
 
void typecheck_expr_side_effect (side_effect_exprt &) override
 
void typecheck_side_effect_assignment (side_effect_exprt &) override
 
void typecheck_side_effect_inc_dec (side_effect_exprt &)
 
void typecheck_expr_typecast (exprt &) override
 
void typecheck_expr_index (exprt &) override
 
void typecheck_expr_rel (binary_relation_exprt &) override
 
void typecheck_expr_comma (exprt &) override
 
void typecheck_function_call_arguments (side_effect_expr_function_callt &) override
 
bool operator_is_overloaded (exprt &)
 
bool overloadable (const exprt &)
 
void add_implicit_dereference (exprt &)
 
void typecheck_side_effect_function_call (side_effect_expr_function_callt &) override
 
void typecheck_method_application (side_effect_expr_function_callt &)
 
- Protected Member Functions inherited from c_typecheck_baset
virtual void do_initializer (exprt &initializer, const typet &type, bool force_constant)
 
virtual exprt do_initializer_rec (const exprt &value, const typet &type, bool force_constant)
 initialize something of type ‘type’ with given value ‘value’ More...
 
virtual exprt do_initializer_list (const exprt &value, const typet &type, bool force_constant)
 
virtual exprt::operandst::const_iterator do_designated_initializer (exprt &result, designatort &designator, const exprt &initializer_list, exprt::operandst::const_iterator init_it, bool force_constant)
 
designatort make_designator (const typet &type, const exprt &src)
 
void designator_enter (const typet &type, designatort &designator)
 
void increment_designator (designatort &designator)
 
bool gcc_vector_types_compatible (const vector_typet &, const vector_typet &)
 
virtual void implicit_typecast_arithmetic (exprt &expr)
 
virtual void implicit_typecast_arithmetic (exprt &expr1, exprt &expr2)
 
virtual void implicit_typecast_bool (exprt &expr)
 
virtual void start_typecheck_code ()
 
virtual void typecheck_assign (codet &expr)
 
virtual void typecheck_asm (code_asmt &code)
 
virtual void typecheck_break (codet &code)
 
virtual void typecheck_continue (codet &code)
 
virtual void typecheck_expression (codet &code)
 
virtual void typecheck_for (codet &code)
 
virtual void typecheck_goto (code_gotot &code)
 
virtual void typecheck_label (code_labelt &code)
 
virtual void typecheck_switch_case (code_switch_caset &code)
 
virtual void typecheck_gcc_computed_goto (codet &code)
 
virtual void typecheck_gcc_switch_case_range (code_gcc_switch_case_ranget &)
 
virtual void typecheck_gcc_local_label (codet &code)
 
virtual void typecheck_return (code_frontend_returnt &)
 
virtual void typecheck_dowhile (code_dowhilet &code)
 
virtual void typecheck_start_thread (codet &code)
 
virtual void typecheck_typed_target_call (side_effect_expr_function_callt &expr)
 
virtual void typecheck_obeys_contract_call (side_effect_expr_function_callt &expr)
 Checks an obeys_contract predicate occurrence. More...
 
virtual void check_history_expr_return_value (const exprt &expr, std::string &clause_type)
 Checks that no history expr or return_value exists in expr. More...
 
virtual void check_was_freed (const exprt &expr, std::string &clause_type)
 Checks that no occurence of the CPROVER_PREFIX was_freed predicate is found in expr. More...
 
virtual void typecheck_spec_frees (exprt::operandst &targets)
 
virtual void typecheck_conditional_targets (exprt::operandst &targets, const std::function< void(exprt &)> typecheck_target, const std::string &clause_type)
 
virtual void typecheck_spec_condition (exprt &condition)
 
virtual void typecheck_spec_assigns_target (exprt &target)
 
virtual void typecheck_spec_frees_target (exprt &target)
 
virtual void typecheck_spec_loop_invariant (codet &code)
 
virtual void typecheck_spec_decreases (codet &code)
 
virtual void throw_on_side_effects (const exprt &expr)
 
virtual void typecheck_expr_builtin_va_arg (exprt &expr)
 
virtual void typecheck_expr_builtin_offsetof (exprt &expr)
 
virtual void typecheck_expr_cw_va_arg_typeof (exprt &expr)
 
virtual void typecheck_expr_operands (exprt &expr)
 
virtual void typecheck_expr_constant (exprt &expr)
 
virtual void typecheck_expr_unary_arithmetic (exprt &expr)
 
virtual void typecheck_expr_unary_boolean (exprt &expr)
 
virtual void typecheck_expr_shifts (shift_exprt &expr)
 
virtual void typecheck_expr_pointer_arithmetic (exprt &expr)
 
virtual void typecheck_arithmetic_pointer (exprt &expr)
 
virtual void typecheck_expr_binary_boolean (exprt &expr)
 
virtual void typecheck_expr_rel_vector (binary_exprt &expr)
 
virtual void adjust_float_rel (binary_relation_exprt &)
 
virtual void typecheck_expr_symbol (exprt &expr)
 
virtual void typecheck_expr_alignof (exprt &expr)
 
virtual void typecheck_side_effect_gcc_conditional_expression (side_effect_exprt &expr)
 
virtual void typecheck_side_effect_statement_expression (side_effect_exprt &expr)
 
virtual exprt do_special_functions (side_effect_expr_function_callt &expr)
 
exprt typecheck_builtin_overflow (side_effect_expr_function_callt &expr, const irep_idt &arith_op)
 
exprt typecheck_saturating_arithmetic (const side_effect_expr_function_callt &expr)
 
virtual std::optional< symbol_exprttypecheck_gcc_polymorphic_builtin (const irep_idt &identifier, const exprt::operandst &arguments, const source_locationt &source_location)
 
virtual code_blockt instantiate_gcc_polymorphic_builtin (const irep_idt &identifier, const symbol_exprt &function_symbol)
 
virtual std::optional< symbol_exprttypecheck_shadow_memory_builtin (const side_effect_expr_function_callt &expr)
 Typecheck the function if it is a shadow_memory builtin and return a symbol for it. More...
 
virtual exprt typecheck_shuffle_vector (const side_effect_expr_function_callt &expr)
 
void disallow_subexpr_by_id (const exprt &, const irep_idt &, const std::string &) const
 
virtual void make_index_type (exprt &expr)
 
virtual void make_constant (exprt &expr)
 
virtual void make_constant_index (exprt &expr)
 
virtual bool gcc_types_compatible_p (const typet &, const typet &)
 
virtual void typecheck_c_enum_type (typet &type)
 
virtual void typecheck_c_enum_tag_type (c_enum_tag_typet &type)
 
virtual void typecheck_code_type (code_typet &type)
 
virtual void typecheck_typedef_type (typet &type)
 
virtual void typecheck_c_bit_field_type (c_bit_field_typet &type)
 
virtual void typecheck_typeof_type (typet &type)
 
virtual void typecheck_array_type (array_typet &type)
 
virtual void typecheck_vector_type (typet &type)
 
virtual void typecheck_custom_type (typet &type)
 
virtual void adjust_function_parameter (typet &type) const
 
virtual bool is_complete_type (const typet &type) const
 
typet enum_constant_type (const mp_integer &min, const mp_integer &max) const
 
bitvector_typet enum_underlying_type (const mp_integer &min, const mp_integer &max, bool is_packed) const
 
void move_symbol (symbolt &symbol, symbolt *&new_symbol)
 
void move_symbol (symbolt &symbol)
 
void typecheck_declaration (ansi_c_declarationt &)
 
void typecheck_symbol (symbolt &symbol)
 
void typecheck_new_symbol (symbolt &symbol)
 
void typecheck_redefinition_type (symbolt &old_symbol, symbolt &new_symbol)
 
void typecheck_redefinition_non_type (symbolt &old_symbol, symbolt &new_symbol)
 
void typecheck_function_body (symbolt &symbol)
 
void add_parameters_to_symbol_table (symbolt &symbol)
 Create symbols for parameter of the code-typed symbol symbol. More...
 
virtual void do_initializer (symbolt &symbol)
 
void apply_asm_label (const irep_idt &asm_label, symbolt &symbol)
 

Static Protected Member Functions

static bool has_const (const typet &type)
 
static bool has_volatile (const typet &type)
 
static bool has_auto (const typet &type)
 
- Static Protected Member Functions inherited from c_typecheck_baset
static void add_rounding_mode (exprt &)
 
static bool is_numeric_type (const typet &src)
 

Protected Attributes

cpp_scopest cpp_scopes
 
cpp_parse_treetcpp_parse_tree
 
irep_idt current_linkage_spec
 
instantiation_stackt instantiation_stack
 
unsigned template_counter
 
unsigned anon_counter
 
template_mapt template_map
 
std::set< irep_idtmethods_seen
 
method_bodiest method_bodies
 
- Protected Attributes inherited from c_typecheck_baset
symbol_table_basetsymbol_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_locationtlabels_defined
 
std::map< irep_idt, source_locationtlabels_used
 
std::list< codetclean_code
 
asm_label_mapt asm_label_map
 
- Protected Attributes inherited from messaget
message_handlertmessage_handler
 
mstreamt mstream
 
- Protected Attributes inherited from namespacet
const symbol_table_basetsymbol_table1
 
const symbol_table_basetsymbol_table2
 

Private Types

typedef std::list< irep_idtdynamic_initializationst
 

Private Attributes

dynamic_initializationst dynamic_initializations
 
bool disable_access_control
 
std::unordered_set< irep_idtdeferred_typechecking
 
bool support_float16_type
 

Friends

class cpp_typecheck_resolvet
 
class cpp_declarator_convertert
 

Additional Inherited Members

- Public Types inherited from messaget
enum  message_levelt {
  M_ERROR =1 , M_WARNING =2 , M_RESULT =4 , M_STATUS =6 ,
  M_STATISTICS =8 , M_PROGRESS =9 , M_DEBUG =10
}
 
- Static Public Member Functions inherited from messaget
static unsigned eval_verbosity (const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
 Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest. More...
 
static commandt command (unsigned c)
 Create an ECMA-48 SGR (Select Graphic Rendition) command. More...
 
- Static Public Attributes inherited from messaget
static eomt eom
 
static const commandt reset
 return to default formatting, as defined by the terminal More...
 
static const commandt red
 render text with red foreground color More...
 
static const commandt green
 render text with green foreground color More...
 
static const commandt yellow
 render text with yellow foreground color More...
 
static const commandt blue
 render text with blue foreground color More...
 
static const commandt magenta
 render text with magenta foreground color More...
 
static const commandt cyan
 render text with cyan foreground color More...
 
static const commandt bright_red
 render text with bright red foreground color More...
 
static const commandt bright_green
 render text with bright green foreground color More...
 
static const commandt bright_yellow
 render text with bright yellow foreground color More...
 
static const commandt bright_blue
 render text with bright blue foreground color More...
 
static const commandt bright_magenta
 render text with bright magenta foreground color More...
 
static const commandt bright_cyan
 render text with bright cyan foreground color More...
 
static const commandt bold
 render text with bold font More...
 
static const commandt faint
 render text with faint font More...
 
static const commandt italic
 render italic text More...
 
static const commandt underline
 render underlined text More...
 

Detailed Description

Definition at line 42 of file cpp_typecheck.h.

Member Typedef Documentation

◆ dynamic_initializationst

Definition at line 577 of file cpp_typecheck.h.

◆ instantiation_stackt

Definition at line 164 of file cpp_typecheck.h.

◆ method_bodiest

typedef std::list<method_bodyt> cpp_typecheckt::method_bodiest
protected

Definition at line 325 of file cpp_typecheck.h.

Constructor & Destructor Documentation

◆ cpp_typecheckt() [1/2]

cpp_typecheckt::cpp_typecheckt ( cpp_parse_treet _cpp_parse_tree,
symbol_table_baset _symbol_table,
const std::string &  _module,
message_handlert message_handler 
)

Definition at line 25 of file cpp_typecheck.cpp.

◆ cpp_typecheckt() [2/2]

cpp_typecheckt::cpp_typecheckt ( cpp_parse_treet _cpp_parse_tree,
symbol_table_baset _symbol_table1,
const symbol_table_baset _symbol_table2,
const std::string &  _module,
message_handlert message_handler 
)

Definition at line 50 of file cpp_typecheck.cpp.

◆ ~cpp_typecheckt()

cpp_typecheckt::~cpp_typecheckt ( )
inlineoverride

Definition at line 58 of file cpp_typecheck.h.

Member Function Documentation

◆ add_anonymous_members_to_scope()

void cpp_typecheckt::add_anonymous_members_to_scope ( const symbolt struct_union_symbol)
protected

Definition at line 1376 of file cpp_typecheck_compound_type.cpp.

◆ add_base_components()

void cpp_typecheckt::add_base_components ( const struct_typet from,
const irep_idt access,
struct_typet to,
std::set< irep_idt > &  bases,
std::set< irep_idt > &  vbases,
bool  is_virtual 
)
protected

Definition at line 119 of file cpp_typecheck_bases.cpp.

◆ add_implicit_dereference()

void cpp_typecheckt::add_implicit_dereference ( exprt expr)
protected

Definition at line 1486 of file cpp_typecheck_expr.cpp.

◆ add_method_body()

void cpp_typecheckt::add_method_body ( symbolt _method_symbol)
protected

Definition at line 51 of file cpp_typecheck_method_bodies.cpp.

◆ add_this_to_method_type()

void cpp_typecheckt::add_this_to_method_type ( const symbolt compound_symbol,
code_typet method_type,
const typet method_qualifier 
)
protected

Definition at line 1347 of file cpp_typecheck_compound_type.cpp.

◆ builtin_factory()

bool cpp_typecheckt::builtin_factory ( const irep_idt identifier)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 378 of file cpp_typecheck.cpp.

◆ cast_away_constness()

bool cpp_typecheckt::cast_away_constness ( const typet t1,
const typet t2 
) const
protected

Definition at line 1620 of file cpp_typecheck_conversions.cpp.

◆ check_component_access()

bool cpp_typecheckt::check_component_access ( const struct_union_typet::componentt component,
const struct_union_typet struct_union_type 
)
protected

Definition at line 1592 of file cpp_typecheck_compound_type.cpp.

◆ check_fixed_size_array()

void cpp_typecheckt::check_fixed_size_array ( typet type)
protected

check that an array has fixed size

Definition at line 766 of file cpp_typecheck_compound_type.cpp.

◆ check_member_initializers()

void cpp_typecheckt::check_member_initializers ( const struct_typet::basest bases,
const struct_typet::componentst components,
const irept initializers 
)
protected

Check a constructor initialization-list.

An initializer has to be a data member declared in this class or a direct-parent constructor. If an invalid initializer is found, then the method outputs an error message and throws a 0 exception.

Parameters
basesthe parents of the class
componentsthe components of the class
initializersthe constructor initializers

Definition at line 420 of file cpp_typecheck_constructor.cpp.

◆ class_template_identifier()

std::string cpp_typecheckt::class_template_identifier ( const irep_idt base_name,
const template_typet template_type,
const cpp_template_args_non_tct partial_specialization_args 
)
protected

Definition at line 414 of file cpp_typecheck_template.cpp.

◆ class_template_symbol()

const symbolt & cpp_typecheckt::class_template_symbol ( const source_locationt source_location,
const symbolt template_symbol,
const cpp_template_args_tct specialization_template_args,
const cpp_template_args_tct full_template_args 
)
protected

Definition at line 147 of file cpp_instantiate_template.cpp.

◆ clean_up()

void cpp_typecheckt::clean_up ( )
protected

Definition at line 318 of file cpp_typecheck.cpp.

◆ const_typecast()

bool cpp_typecheckt::const_typecast ( const exprt expr,
const typet type,
exprt new_expr 
)

Definition at line 1687 of file cpp_typecheck_conversions.cpp.

◆ contains_cpp_name()

bool cpp_typecheckt::contains_cpp_name ( const exprt expr)

Definition at line 384 of file cpp_typecheck.cpp.

◆ convert() [1/7]

void cpp_typecheckt::convert ( cpp_declarationt declaration)
protected

Definition at line 19 of file cpp_typecheck_declaration.cpp.

◆ convert() [2/7]

void cpp_typecheckt::convert ( cpp_declaratort )
protected

◆ convert() [3/7]

void cpp_typecheckt::convert ( cpp_itemt item)
protected

Definition at line 76 of file cpp_typecheck.cpp.

◆ convert() [4/7]

void cpp_typecheckt::convert ( cpp_linkage_spect linkage_spec)
protected

Definition at line 14 of file cpp_typecheck_linkage_spec.cpp.

◆ convert() [5/7]

void cpp_typecheckt::convert ( cpp_namespace_spect namespace_spec)
protected

Definition at line 17 of file cpp_typecheck_namespace.cpp.

◆ convert() [6/7]

void cpp_typecheckt::convert ( cpp_static_assertt cpp_static_assert)
protected

Definition at line 16 of file cpp_typecheck_static_assert.cpp.

◆ convert() [7/7]

void cpp_typecheckt::convert ( cpp_usingt cpp_using)
protected

Definition at line 16 of file cpp_typecheck_using.cpp.

◆ convert_anon_struct_union_member()

void cpp_typecheckt::convert_anon_struct_union_member ( const cpp_declarationt declaration,
const irep_idt access,
struct_typet::componentst components 
)
protected

Definition at line 1426 of file cpp_typecheck_compound_type.cpp.

◆ convert_anonymous_union()

codet cpp_typecheckt::convert_anonymous_union ( cpp_declarationt declaration)
protected

Definition at line 36 of file cpp_typecheck_declaration.cpp.

◆ convert_class_template_specialization()

void cpp_typecheckt::convert_class_template_specialization ( cpp_declarationt declaration)
protected

Definition at line 490 of file cpp_typecheck_template.cpp.

◆ convert_function()

void cpp_typecheckt::convert_function ( symbolt symbol)
protected

Definition at line 82 of file cpp_typecheck_function.cpp.

◆ convert_initializer()

void cpp_typecheckt::convert_initializer ( symbolt symbol)
protected

Initialize an object with a value.

Definition at line 24 of file cpp_typecheck_initializer.cpp.

◆ convert_non_template_declaration()

void cpp_typecheckt::convert_non_template_declaration ( cpp_declarationt declaration)
protected

Definition at line 108 of file cpp_typecheck_declaration.cpp.

◆ convert_parameter()

void cpp_typecheckt::convert_parameter ( const irep_idt current_mode,
code_typet::parametert parameter 
)
protected

Definition at line 19 of file cpp_typecheck_function.cpp.

◆ convert_parameters()

void cpp_typecheckt::convert_parameters ( const irep_idt current_mode,
code_typet function_type 
)
protected

Definition at line 68 of file cpp_typecheck_function.cpp.

◆ convert_pmop()

void cpp_typecheckt::convert_pmop ( exprt expr)
protected

Definition at line 2178 of file cpp_typecheck_expr.cpp.

◆ convert_template_declaration()

void cpp_typecheckt::convert_template_declaration ( cpp_declarationt declaration)
protected

Definition at line 960 of file cpp_typecheck_template.cpp.

◆ convert_template_function_or_member_specialization()

void cpp_typecheckt::convert_template_function_or_member_specialization ( cpp_declarationt declaration)
protected

Definition at line 608 of file cpp_typecheck_template.cpp.

◆ cpp_constructor()

std::optional< codet > cpp_typecheckt::cpp_constructor ( const source_locationt source_location,
const exprt object,
const exprt::operandst operands 
)
Parameters
source_locationsource location for generated code
objectnon-typechecked object
operandsnon-typechecked operands
Returns
typechecked code

Definition at line 22 of file cpp_constructor.cpp.

◆ cpp_destructor()

std::optional< codet > cpp_typecheckt::cpp_destructor ( const source_locationt source_location,
const exprt object 
)
protected
Returns
typechecked code

Definition at line 19 of file cpp_destructor.cpp.

◆ cpp_is_pod()

bool cpp_typecheckt::cpp_is_pod ( const typet type) const

Definition at line 16 of file cpp_is_pod.cpp.

◆ default_assignop()

void cpp_typecheckt::default_assignop ( const symbolt symbol,
cpp_declarationt cpctor 
)
protected

Generate declaration of the implicit default assignment operator.

Definition at line 277 of file cpp_typecheck_constructor.cpp.

◆ default_assignop_value()

void cpp_typecheckt::default_assignop_value ( const symbolt symbol,
cpp_declaratort declarator 
)
protected

Generate code for the implicit default assignment operator.

Definition at line 347 of file cpp_typecheck_constructor.cpp.

◆ default_cpctor()

void cpp_typecheckt::default_cpctor ( const symbolt symbol,
cpp_declarationt cpctor 
) const
protected

Generate code for implicit default copy constructor.

Definition at line 140 of file cpp_typecheck_constructor.cpp.

◆ default_ctor()

void cpp_typecheckt::default_ctor ( const source_locationt source_location,
const irep_idt base_name,
cpp_declarationt ctor 
) const
protected

Generate code for implicit default constructors.

Definition at line 118 of file cpp_typecheck_constructor.cpp.

◆ default_dtor()

void cpp_typecheckt::default_dtor ( const symbolt symb,
cpp_declarationt dtor 
)
protected

Note:

Definition at line 28 of file cpp_typecheck_destructor.cpp.

◆ do_not_typechecked()

void cpp_typecheckt::do_not_typechecked ( )
protected

Definition at line 267 of file cpp_typecheck.cpp.

◆ do_virtual_table()

void cpp_typecheckt::do_virtual_table ( const symbolt symbol)
protected

Definition at line 19 of file cpp_typecheck_virtual_table.cpp.

◆ dtor()

codet cpp_typecheckt::dtor ( const symbolt symb,
const symbol_exprt this_expr 
)
protected

produces destructor code for a class object

Definition at line 49 of file cpp_typecheck_destructor.cpp.

◆ dynamic_typecast()

bool cpp_typecheckt::dynamic_typecast ( const exprt expr,
const typet type,
exprt new_expr 
)

Definition at line 1745 of file cpp_typecheck_conversions.cpp.

◆ elaborate_class_template() [1/2]

void cpp_typecheckt::elaborate_class_template ( const source_locationt source_location,
const struct_tag_typet type 
)
protected

◆ elaborate_class_template() [2/2]

void cpp_typecheckt::elaborate_class_template ( const typet type)
protected

elaborate class template instances

Definition at line 217 of file cpp_instantiate_template.cpp.

◆ explicit_typecast_ambiguity()

void cpp_typecheckt::explicit_typecast_ambiguity ( exprt expr)
protected

Definition at line 2275 of file cpp_typecheck_expr.cpp.

◆ find_assignop()

bool cpp_typecheckt::find_assignop ( const symbolt symbol) const
protected

Definition at line 815 of file cpp_typecheck_constructor.cpp.

◆ find_cpctor()

bool cpp_typecheckt::find_cpctor ( const symbolt symbol) const
protected
parameters: typechecked compound symbol
Returns
return true if a copy constructor is found

Definition at line 762 of file cpp_typecheck_constructor.cpp.

◆ find_dtor()

bool cpp_typecheckt::find_dtor ( const symbolt symbol) const
protected

Definition at line 16 of file cpp_typecheck_destructor.cpp.

◆ find_parent()

bool cpp_typecheckt::find_parent ( const symbolt symb,
const irep_idt base_name,
irep_idt identifier 
)
protected

Definition at line 35 of file cpp_typecheck_expr.cpp.

◆ full_member_initialization()

void cpp_typecheckt::full_member_initialization ( const struct_union_typet struct_union_type,
irept initializers 
)
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.

Parameters
struct_union_typethe class/struct/union
[out]initializersthe constructor initializers

Definition at line 545 of file cpp_typecheck_constructor.cpp.

◆ function_identifier()

irep_idt cpp_typecheckt::function_identifier ( const typet type)
protected

for function overloading

Definition at line 163 of file cpp_typecheck_function.cpp.

◆ function_template_identifier()

std::string cpp_typecheckt::function_template_identifier ( const irep_idt base_name,
const template_typet template_type,
const typet function_type 
)
protected

Definition at line 473 of file cpp_typecheck_template.cpp.

◆ get_bases()

void cpp_typecheckt::get_bases ( const struct_typet type,
std::set< irep_idt > &  set_bases 
) const

Definition at line 1652 of file cpp_typecheck_compound_type.cpp.

◆ get_component()

bool cpp_typecheckt::get_component ( const source_locationt source_location,
const exprt object,
const irep_idt component_name,
exprt member 
)
protected

Definition at line 1485 of file cpp_typecheck_compound_type.cpp.

◆ get_virtual_bases()

void cpp_typecheckt::get_virtual_bases ( const struct_typet type,
std::list< irep_idt > &  vbases 
) const

Definition at line 1667 of file cpp_typecheck_compound_type.cpp.

◆ has_auto()

bool cpp_typecheckt::has_auto ( const typet type)
staticprotected

Definition at line 68 of file cpp_typecheck_compound_type.cpp.

◆ has_const()

bool cpp_typecheckt::has_const ( const typet type)
staticprotected

Definition at line 32 of file cpp_typecheck_compound_type.cpp.

◆ has_volatile()

bool cpp_typecheckt::has_volatile ( const typet type)
staticprotected

Definition at line 50 of file cpp_typecheck_compound_type.cpp.

◆ implicit_conversion_sequence() [1/3]

bool cpp_typecheckt::implicit_conversion_sequence ( const exprt expr,
const typet type,
exprt new_expr 
)

implicit conversion sequence

parameters: A typechecked expression 'expr', a destination
type 'type'.
Returns
True iff an implicit conversion sequence exists. The result of the conversion is stored in 'new_expr'.

Definition at line 1511 of file cpp_typecheck_conversions.cpp.

◆ implicit_conversion_sequence() [2/3]

bool cpp_typecheckt::implicit_conversion_sequence ( const exprt expr,
const typet type,
exprt new_expr,
unsigned &  rank 
)

implicit conversion sequence

parameters: A typechecked expression 'expr', a destination
type 'type'.
Returns
True iff an implicit conversion sequence exists. The result of the conversion is stored in 'new_expr'. The rank of the sequence is stored in 'rank'

Definition at line 1445 of file cpp_typecheck_conversions.cpp.

◆ implicit_conversion_sequence() [3/3]

bool cpp_typecheckt::implicit_conversion_sequence ( const exprt expr,
const typet type,
unsigned &  rank 
)

implicit conversion sequence

parameters: A typechecked expression 'expr', a destination
type 'type'.
Returns
True iff an implicit conversion sequence exists. The rank of the sequence is stored in 'rank'

Definition at line 1525 of file cpp_typecheck_conversions.cpp.

◆ implicit_typecast()

void cpp_typecheckt::implicit_typecast ( exprt expr,
const typet type 
)
overridevirtual

Reimplemented from c_typecheck_baset.

Definition at line 1534 of file cpp_typecheck_conversions.cpp.

◆ instantiate_template()

const symbolt & cpp_typecheckt::instantiate_template ( const source_locationt source_location,
const symbolt symbol,
const cpp_template_args_tct specialization_template_args,
const cpp_template_args_tct full_template_args,
const typet specialization = uninitialized_typet{} 
)
protected

Definition at line 246 of file cpp_instantiate_template.cpp.

◆ make_ptr_typecast()

void cpp_typecheckt::make_ptr_typecast ( exprt expr,
const pointer_typet dest_type 
)

Definition at line 1701 of file cpp_typecheck_compound_type.cpp.

◆ move_member_initializers()

void cpp_typecheckt::move_member_initializers ( irept initializers,
const code_typet type,
exprt value 
)
protected

Definition at line 1228 of file cpp_typecheck_compound_type.cpp.

◆ new_temporary() [1/2]

void cpp_typecheckt::new_temporary ( const source_locationt source_location,
const typet type,
const exprt op,
exprt temporary 
)
protected

Definition at line 294 of file cpp_constructor.cpp.

◆ new_temporary() [2/2]

void cpp_typecheckt::new_temporary ( const source_locationt source_location,
const typet type,
const exprt::operandst ops,
exprt temporary 
)
protected

Definition at line 264 of file cpp_constructor.cpp.

◆ operator_is_overloaded()

bool cpp_typecheckt::operator_is_overloaded ( exprt expr)
protected

Definition at line 460 of file cpp_typecheck_expr.cpp.

◆ overloadable()

bool cpp_typecheckt::overloadable ( const exprt expr)
protected

Definition at line 404 of file cpp_typecheck_expr.cpp.

◆ put_compound_into_scope()

void cpp_typecheckt::put_compound_into_scope ( const struct_union_typet::componentt component)
protected

Definition at line 791 of file cpp_typecheck_compound_type.cpp.

◆ reference_binding()

bool cpp_typecheckt::reference_binding ( exprt  expr,
const reference_typet reference_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).

parameters: A typechecked expression 'expr', a
reference 'type'.
Returns
True iff an the reference can be bound to the expression. The result of the conversion is stored in 'new_expr'.

Definition at line 1234 of file cpp_typecheck_conversions.cpp.

◆ reference_compatible()

bool cpp_typecheckt::reference_compatible ( const exprt expr,
const reference_typet reference_type,
unsigned &  rank 
) const

Reference-compatible.

parameters: A typechecked expression 'expr', a
reference 'type'.
Returns
True iff an the reference 'type' is reference-compatible to 'expr'.

Definition at line 1172 of file cpp_typecheck_conversions.cpp.

◆ reference_initializer()

void cpp_typecheckt::reference_initializer ( exprt expr,
const reference_typet reference_type 
)

A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows:

  • If the initializer expression

    • is an lvalue (but is not a bit-field), and "cv1 T1" is reference-compatible with "cv2 T2," or
    • has a class type (i.e., T2 is a class type) and can be implicitly converted to an lvalue of type "cv3 T3," where "cv1 T1" is reference-compatible with "cv3 T3" 92) (this conversion is selected by enumerating the applicable conversion functions (13.3.1.6) and choosing the best one through overload resolution (13.3)),

    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.

  • Otherwise, the reference shall be to a non-volatile const type
    • 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 reference is bound to the object represented by the rvalue (see 3.10) or to a sub-object within that object.
      • A temporary of type "cv1 T2" [sic] is created, and a constructor is called to copy the entire rvalue object into the temporary. The reference is bound to the temporary or to a sub-object within the temporary.

      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 1601 of file cpp_typecheck_conversions.cpp.

◆ reference_related()

bool cpp_typecheckt::reference_related ( const exprt expr,
const reference_typet reference_type 
) const

Reference-related.

parameters: A typechecked expression 'expr',
a reference 'type'.
Returns
True iff the reference 'type' is reference-related to 'expr'.

Definition at line 1123 of file cpp_typecheck_conversions.cpp.

◆ reinterpret_typecast()

bool cpp_typecheckt::reinterpret_typecast ( const exprt expr,
const typet type,
exprt new_expr,
bool  check_constantness = true 
)

Definition at line 1797 of file cpp_typecheck_conversions.cpp.

◆ resolve()

exprt cpp_typecheckt::resolve ( const cpp_namet cpp_name,
const cpp_typecheck_resolvet::wantt  want,
const cpp_typecheck_fargst fargs,
bool  fail_with_exception = true 
)
inline

Definition at line 71 of file cpp_typecheck.h.

◆ salvage_default_arguments()

void cpp_typecheckt::salvage_default_arguments ( const template_typet old_type,
template_typet new_type 
)
protected

Definition at line 23 of file cpp_typecheck_template.cpp.

◆ show_instantiation_stack()

void cpp_typecheckt::show_instantiation_stack ( std::ostream &  out)
protected

Definition at line 91 of file cpp_instantiate_template.cpp.

◆ standard_conversion_array_to_pointer()

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.

parameters: An array expression
Returns
True iff the array-to-pointer conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 77 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_boolean()

bool cpp_typecheckt::standard_conversion_boolean ( const exprt expr,
exprt new_expr 
) const

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.

parameters: A typechecked expression 'expr'
Returns
True iff the boolean conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 636 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_floating_integral_conversion()

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.

parameters: A typechecked expression 'expr'
Returns
True iff the conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 347 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_floating_point_conversion()

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.

parameters: A typechecked expression 'expr', a destination
type 'type'
Returns
True iff the floating-point conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 398 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_floating_point_promotion()

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.

parameters: A typechecked expression 'expr'
Returns
True iff the integral promotion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 246 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_function_to_pointer()

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)

parameters: A function expression
Returns
True iff the array-to-pointer conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 99 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_integral_conversion()

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.

parameters: A typechecked expression 'expr', a destination
type 'type'
Returns
True iff the integral promotion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 300 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_integral_promotion()

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.

parameters: A typechecked expression 'expr'
Returns
True iff the integral promotion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 193 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_lvalue_to_rvalue()

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.

parameters: A typechecked lvalue expression
Returns
True iff the lvalue-to-rvalue conversion is possible. 'new_type' contains the result of the conversion.

Definition at line 46 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_pointer()

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.

parameters: A typechecked expression 'expr', a destination
type 'type'
Returns
True iff the pointer conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 455 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_pointer_to_member()

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)

parameters: A typechecked expression 'expr', a destination
type 'type'
Returns
True iff the pointer-to-member conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 554 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_qualification()

bool cpp_typecheckt::standard_conversion_qualification ( const exprt expr,
const typet type,
exprt new_expr 
) const

Qualification conversion.

parameters: A typechecked expression 'expr', a destination
type 'type'
Returns
True iff the qualification conversion is possible. The result of the conversion is stored in 'new_expr'.

Definition at line 115 of file cpp_typecheck_conversions.cpp.

◆ standard_conversion_sequence()

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:

  • Zero or one conversion from the following set: lvalue-to-rvalue conversion, array-to-pointer conversion, and function-to-pointer conversion.
  • Zero or one conversion from the following set: integral promotions, floating point promotion, integral conversions, floating point conversions, floating-integral conversions, pointer conversions, pointer to member conversions, and boolean conversions.
  • Zero or one qualification conversion.
    parameters: A typechecked expression 'expr', a destination
    type 'type'.
    Returns
    True iff a standard conversion sequence exists. The result of the conversion is stored in 'new_expr'. The reference 'rank' is incremented.

Definition at line 680 of file cpp_typecheck_conversions.cpp.

◆ static_and_dynamic_initialization()

void cpp_typecheckt::static_and_dynamic_initialization ( )
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 205 of file cpp_typecheck.cpp.

◆ static_typecast()

bool cpp_typecheckt::static_typecast ( const exprt expr,
const typet type,
exprt new_expr,
bool  check_constantness = true 
)

Definition at line 1893 of file cpp_typecheck_conversions.cpp.

◆ sub_scope_for_instantiation()

cpp_scopet & cpp_typecheckt::sub_scope_for_instantiation ( cpp_scopet template_scope,
const std::string &  suffix 
)
protected

Set up a scope as subscope of the template scope.

Definition at line 114 of file cpp_instantiate_template.cpp.

◆ subtype_typecast()

bool cpp_typecheckt::subtype_typecast ( const struct_typet from,
const struct_typet to 
) const

Definition at line 1687 of file cpp_typecheck_compound_type.cpp.

◆ tag_scope()

cpp_scopet & cpp_typecheckt::tag_scope ( const irep_idt _base_name,
bool  has_body,
bool  tag_only_declaration 
)
protected

Definition at line 88 of file cpp_typecheck_compound_type.cpp.

◆ template_suffix()

std::string cpp_typecheckt::template_suffix ( const cpp_template_args_tct template_args)
protected

Definition at line 24 of file cpp_instantiate_template.cpp.

◆ this_struct_type()

const struct_typet & cpp_typecheckt::this_struct_type ( )
protected

Definition at line 114 of file cpp_typecheck.cpp.

◆ to_string() [1/2]

std::string cpp_typecheckt::to_string ( const exprt expr)
overridevirtual

Reimplemented from c_typecheck_baset.

Definition at line 127 of file cpp_typecheck.cpp.

◆ to_string() [2/2]

std::string cpp_typecheckt::to_string ( const typet type)
overridevirtual

Reimplemented from c_typecheck_baset.

Definition at line 132 of file cpp_typecheck.cpp.

◆ typecheck()

void cpp_typecheckt::typecheck ( )
overridevirtual

typechecking main method

Implements c_typecheck_baset.

Definition at line 97 of file cpp_typecheck.cpp.

◆ typecheck_block()

void cpp_typecheckt::typecheck_block ( code_blockt code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 510 of file cpp_typecheck_code.cpp.

◆ typecheck_cast_expr()

void cpp_typecheckt::typecheck_cast_expr ( exprt expr)
protected

Definition at line 1275 of file cpp_typecheck_expr.cpp.

◆ typecheck_class_template()

void cpp_typecheckt::typecheck_class_template ( cpp_declarationt declaration)
protected

Definition at line 44 of file cpp_typecheck_template.cpp.

◆ typecheck_class_template_member()

void cpp_typecheckt::typecheck_class_template_member ( cpp_declarationt declaration)
protected

typecheck class template members; these can be methods or static members

Definition at line 304 of file cpp_typecheck_template.cpp.

◆ typecheck_code()

void cpp_typecheckt::typecheck_code ( codet code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 24 of file cpp_typecheck_code.cpp.

◆ typecheck_compound_bases()

void cpp_typecheckt::typecheck_compound_bases ( struct_typet type)
protected

Definition at line 18 of file cpp_typecheck_bases.cpp.

◆ typecheck_compound_body() [1/2]

void cpp_typecheckt::typecheck_compound_body ( struct_union_typet )
inlineoverrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 367 of file cpp_typecheck.h.

◆ typecheck_compound_body() [2/2]

void cpp_typecheckt::typecheck_compound_body ( symbolt symbol)
protected

Definition at line 935 of file cpp_typecheck_compound_type.cpp.

◆ typecheck_compound_declarator()

void cpp_typecheckt::typecheck_compound_declarator ( const symbolt symbol,
const cpp_declarationt declaration,
cpp_declaratort declarator,
struct_typet::componentst components,
const irep_idt access,
bool  is_static,
bool  is_typedef,
bool  is_mutable 
)
protected

Definition at line 292 of file cpp_typecheck_compound_type.cpp.

◆ typecheck_compound_type()

void cpp_typecheckt::typecheck_compound_type ( struct_union_typet type)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 127 of file cpp_typecheck_compound_type.cpp.

◆ typecheck_decl()

void cpp_typecheckt::typecheck_decl ( codet code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 401 of file cpp_typecheck_code.cpp.

◆ typecheck_enum_body()

void cpp_typecheckt::typecheck_enum_body ( symbolt symbol)
protected

Definition at line 22 of file cpp_typecheck_enum_type.cpp.

◆ typecheck_enum_type()

void cpp_typecheckt::typecheck_enum_type ( typet type)
protected

Definition at line 85 of file cpp_typecheck_enum_type.cpp.

◆ typecheck_expr()

void cpp_typecheckt::typecheck_expr ( exprt expr)
overridevirtual

Reimplemented from c_typecheck_baset.

Definition at line 2254 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_address_of()

void cpp_typecheckt::typecheck_expr_address_of ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 665 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_binary_arithmetic()

void cpp_typecheckt::typecheck_expr_binary_arithmetic ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2332 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_comma()

void cpp_typecheckt::typecheck_expr_comma ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2352 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_cpp_name()

void cpp_typecheckt::typecheck_expr_cpp_name ( exprt expr,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 1379 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_delete()

void cpp_typecheckt::typecheck_expr_delete ( exprt expr)
protected

Definition at line 998 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_dereference()

void cpp_typecheckt::typecheck_expr_dereference ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2155 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_explicit_constructor_call()

void cpp_typecheckt::typecheck_expr_explicit_constructor_call ( exprt expr)
protected

Definition at line 958 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_explicit_typecast()

void cpp_typecheckt::typecheck_expr_explicit_typecast ( exprt expr)
protected

Definition at line 849 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_function_identifier()

void cpp_typecheckt::typecheck_expr_function_identifier ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2239 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_index()

void cpp_typecheckt::typecheck_expr_index ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2347 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_main()

void cpp_typecheckt::typecheck_expr_main ( exprt expr)
overrideprotectedvirtual

Called after the operands are done.

Reimplemented from c_typecheck_baset.

Definition at line 54 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_member() [1/2]

void cpp_typecheckt::typecheck_expr_member ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 289 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_member() [2/2]

void cpp_typecheckt::typecheck_expr_member ( exprt expr,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 1064 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_new()

void cpp_typecheckt::typecheck_expr_new ( exprt expr)
protected

Definition at line 754 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_ptrmember() [1/2]

void cpp_typecheckt::typecheck_expr_ptrmember ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 352 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_ptrmember() [2/2]

void cpp_typecheckt::typecheck_expr_ptrmember ( exprt expr,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 1237 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_reference_to()

void cpp_typecheckt::typecheck_expr_reference_to ( exprt )
protected

◆ typecheck_expr_rel()

void cpp_typecheckt::typecheck_expr_rel ( binary_relation_exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2371 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_side_effect()

void cpp_typecheckt::typecheck_expr_side_effect ( side_effect_exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 1885 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_sizeof()

void cpp_typecheckt::typecheck_expr_sizeof ( exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 296 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_this()

void cpp_typecheckt::typecheck_expr_this ( exprt expr)
protected

Definition at line 979 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_throw()

void cpp_typecheckt::typecheck_expr_throw ( exprt expr)
protected

Definition at line 730 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_trinary()

void cpp_typecheckt::typecheck_expr_trinary ( if_exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 133 of file cpp_typecheck_expr.cpp.

◆ typecheck_expr_typecast()

void cpp_typecheckt::typecheck_expr_typecast ( exprt )
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 1055 of file cpp_typecheck_expr.cpp.

◆ typecheck_friend_declaration()

void cpp_typecheckt::typecheck_friend_declaration ( symbolt symbol,
cpp_declarationt cpp_declaration 
)
protected

Definition at line 863 of file cpp_typecheck_compound_type.cpp.

◆ typecheck_function_call_arguments()

void cpp_typecheckt::typecheck_function_call_arguments ( side_effect_expr_function_callt expr)
overrideprotectedvirtual
Parameters
exprfunction call whose arguments need to be checked

Reimplemented from c_typecheck_baset.

Definition at line 1835 of file cpp_typecheck_expr.cpp.

◆ typecheck_function_expr()

void cpp_typecheckt::typecheck_function_expr ( exprt expr,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 357 of file cpp_typecheck_expr.cpp.

◆ typecheck_function_template()

void cpp_typecheckt::typecheck_function_template ( cpp_declarationt declaration)
protected

typecheck function templates

Definition at line 204 of file cpp_typecheck_template.cpp.

◆ typecheck_ifthenelse()

void cpp_typecheckt::typecheck_ifthenelse ( code_ifthenelset code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 157 of file cpp_typecheck_code.cpp.

◆ typecheck_member_function()

void cpp_typecheckt::typecheck_member_function ( const symbolt compound_symbol,
struct_typet::componentt component,
irept initializers,
const typet method_qualifier,
exprt value 
)
protected

Definition at line 1269 of file cpp_typecheck_compound_type.cpp.

◆ typecheck_member_initializer()

void cpp_typecheckt::typecheck_member_initializer ( codet code)
protected

Definition at line 215 of file cpp_typecheck_code.cpp.

◆ typecheck_method_application()

void cpp_typecheckt::typecheck_method_application ( side_effect_expr_function_callt expr)
protected

Definition at line 1919 of file cpp_typecheck_expr.cpp.

◆ typecheck_method_bodies()

void cpp_typecheckt::typecheck_method_bodies ( )
protected

Definition at line 18 of file cpp_typecheck_method_bodies.cpp.

◆ typecheck_side_effect_assignment()

void cpp_typecheckt::typecheck_side_effect_assignment ( side_effect_exprt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 2003 of file cpp_typecheck_expr.cpp.

◆ typecheck_side_effect_function_call()

void cpp_typecheckt::typecheck_side_effect_function_call ( side_effect_expr_function_callt expr)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 1499 of file cpp_typecheck_expr.cpp.

◆ typecheck_side_effect_inc_dec()

void cpp_typecheckt::typecheck_side_effect_inc_dec ( side_effect_exprt expr)
protected

Definition at line 2085 of file cpp_typecheck_expr.cpp.

◆ typecheck_switch()

void cpp_typecheckt::typecheck_switch ( codet code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 185 of file cpp_typecheck_code.cpp.

◆ typecheck_template_args()

cpp_template_args_tct cpp_typecheckt::typecheck_template_args ( const source_locationt source_location,
const symbolt template_symbol,
const cpp_template_args_non_tct template_args 
)
protected
parameters: location, non-typechecked template arguments
Returns
typechecked template arguments

Definition at line 817 of file cpp_typecheck_template.cpp.

◆ typecheck_template_parameters()

cpp_scopet & cpp_typecheckt::typecheck_template_parameters ( template_typet type)
protected

Definition at line 699 of file cpp_typecheck_template.cpp.

◆ typecheck_try_catch()

void cpp_typecheckt::typecheck_try_catch ( codet code)
protected

Definition at line 92 of file cpp_typecheck_code.cpp.

◆ typecheck_type()

void cpp_typecheckt::typecheck_type ( typet type)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 25 of file cpp_typecheck_type.cpp.

◆ typecheck_while()

void cpp_typecheckt::typecheck_while ( code_whilet code)
overrideprotectedvirtual

Reimplemented from c_typecheck_baset.

Definition at line 171 of file cpp_typecheck_code.cpp.

◆ user_defined_conversion_sequence()

bool cpp_typecheckt::user_defined_conversion_sequence ( const exprt expr,
const typet to,
exprt new_expr,
unsigned &  rank 
)

User-defined conversion sequence.

parameters: A typechecked expression 'expr', a destination
type 'type'.
Returns
True iff a user-defined conversion sequence exists. The result of the conversion is stored in 'new_expr'.

Definition at line 863 of file cpp_typecheck_conversions.cpp.

◆ zero_initializer()

void cpp_typecheckt::zero_initializer ( const exprt object,
const typet type,
const source_locationt source_location,
exprt::operandst ops 
)
protected

Definition at line 196 of file cpp_typecheck_initializer.cpp.

Friends And Related Function Documentation

◆ cpp_declarator_convertert

friend class cpp_declarator_convertert
friend

Definition at line 69 of file cpp_typecheck.h.

◆ cpp_typecheck_resolvet

friend class cpp_typecheck_resolvet
friend

Definition at line 68 of file cpp_typecheck.h.

Member Data Documentation

◆ anon_counter

unsigned cpp_typecheckt::anon_counter
protected

Definition at line 209 of file cpp_typecheck.h.

◆ cpp_parse_tree

cpp_parse_treet& cpp_typecheckt::cpp_parse_tree
protected

Definition at line 94 of file cpp_typecheck.h.

◆ cpp_scopes

cpp_scopest cpp_typecheckt::cpp_scopes
protected

Definition at line 92 of file cpp_typecheck.h.

◆ current_linkage_spec

irep_idt cpp_typecheckt::current_linkage_spec
protected

Definition at line 95 of file cpp_typecheck.h.

◆ deferred_typechecking

std::unordered_set<irep_idt> cpp_typecheckt::deferred_typechecking
private

Definition at line 580 of file cpp_typecheck.h.

◆ disable_access_control

bool cpp_typecheckt::disable_access_control
private

Definition at line 579 of file cpp_typecheck.h.

◆ dynamic_initializations

dynamic_initializationst cpp_typecheckt::dynamic_initializations
private

Definition at line 578 of file cpp_typecheck.h.

◆ instantiation_stack

instantiation_stackt cpp_typecheckt::instantiation_stack
protected

Definition at line 165 of file cpp_typecheck.h.

◆ method_bodies

method_bodiest cpp_typecheckt::method_bodies
protected

Definition at line 327 of file cpp_typecheck.h.

◆ methods_seen

std::set<irep_idt> cpp_typecheckt::methods_seen
protected

Definition at line 326 of file cpp_typecheck.h.

◆ support_float16_type

bool cpp_typecheckt::support_float16_type
private

Definition at line 581 of file cpp_typecheck.h.

◆ template_counter

unsigned cpp_typecheckt::template_counter
protected

Definition at line 208 of file cpp_typecheck.h.

◆ template_map

template_mapt cpp_typecheckt::template_map
protected

Definition at line 211 of file cpp_typecheck.h.


The documentation for this class was generated from the following files: