43 codet new_code(ID_decl_block);
50 name.
set(ID_identifier, identifier);
56 declarator.
name()=cpp_name;
61 cpp_declarator_converter.
convert(declaration, declarator);
66 error() <<
"anonymous union is not POD" <<
eom;
81 if(it->find(ID_type).id()==ID_code)
85 <<
"' shall not have function members" <<
eom;
89 const irep_idt &base_name=it->get(ID_base_name);
94 error() <<
"identifier `" << base_name <<
"' already in scope" 101 id.identifier=it->get(ID_name);
102 id.class_identifier=union_symbol.
name;
118 typet &declaration_type=declaration.
type();
139 follow(declaration.
type()).get_bool(ID_C_is_anonymous))
143 if(final_type.
id()!=ID_union)
146 error() <<
"top-level declaration does not declare anything" 163 cpp_declarator_converter.
is_typedef=is_typedef;
172 symbol.
type.
set(ID_C_template, declaration.
find(ID_C_template));
174 ID_C_template_arguments,
175 declaration.
find(ID_C_template_arguments));
C++ Language Type Checking.
The type of an expression.
irep_idt name
The unique identifier.
void typecheck_type(typet &type)
const cpp_storage_spect & storage_spec() const
void convert_non_template_declaration(cpp_declarationt &declaration)
static bool has_auto(const typet &type)
std::vector< irept > subt
void move_to_sub(irept &irep)
void name_anon_struct_union()
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
void move_to_operands(exprt &expr)
exprt value
Initial value of symbol.
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
static mstreamt & eom(mstreamt &m)
const cpp_member_spect & member_spec() const
void convert(cpp_linkage_spect &)
symbol_tablet & symbol_table
virtual symbolt * get_writeable(const irep_idt &name) override
Find a symbol in the symbol table for read-write access.
const irep_idt & id() const
void elaborate_class_template(const typet &type)
elaborate class template instances
const declaratorst & declarators() const
A declaration of a local variable.
void make_already_typechecked(typet &dest)
source_locationt source_location
bool cpp_is_pod(const typet &type) const
const irep_idt & get(const irep_namet &name) const
Base class for tree-like data structures with sharing.
void convert_template_declaration(cpp_declarationt &declaration)
C++ Language Type Checking.
const typet & follow(const typet &) const
bool has_operands() const
const source_locationt & source_location() const
void typecheck_method_bodies(method_bodiest &)
method_bodiest method_bodies
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
void convert_anonymous_union(cpp_declarationt &declaration, codet &new_code)
Base class for all expressions.
bool contains(const irep_idt &base_name)
irep_idt base_name
Base (non-scoped) name.
cpp_scopet & current_scope()
std::string to_string(const string_constraintt &expr)
Used for debug printing.
symbolt & convert(const typet &type, const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
const source_locationt & source_location() const
irept & add(const irep_namet &name)
A statement in a programming language.
exprt cpp_symbol_expr(const symbolt &symbol)
std::list< method_bodyt > method_bodiest
cpp_idt & insert(const irep_idt &_base_name)
const irept & find(const irep_namet &name) const
codet cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
void set(const irep_namet &name, const irep_idt &value)
void reserve_operands(operandst::size_type n)
#define forall_irep(it, irep)