33 for(
const auto &expr : arguments)
41 expr.id() !=
ID_ambiguous,
"template argument must not be ambiguous");
45 const typet &type=expr.type();
76 error() <<
"template argument expression expected to be "
77 <<
"scalar constant, but got '" <<
to_string(e) <<
"'" <<
eom;
95 out <<
"instantiating '" << symbol.
pretty_name <<
"' with <";
99 if(
a_it != e.full_template_args.arguments().begin())
108 out <<
"> at " << e.source_location <<
'\n';
115 const std::string &suffix)
156 if(full_template_args.
arguments().empty())
160 <<
"' is a template; thus, expected template arguments" <<
eom;
178 symbol_tablet::symbolst::const_iterator
s_it=
186 new_symbol.
name=identifier;
214 id.class_identifier=
s_ptr->name;
264 error() <<
"reached maximum template recursion depth ("
275 std::cout <<
"L: " << source_location <<
'\n';
298 std::cout <<
">\n\n";
302 if(full_template_args.
arguments().empty())
306 <<
"' is a template; thus, expected template arguments" <<
eom;
321 <<
"template instantiation error: scope not found" <<
eom;
378 else if(
symb.value.is_not_nil())
395 std::cout <<
"CLASS MAP:\n";
437 static_cast<const irept &
>(
tm));
453 std::cout <<
"METHOD MAP:\n";
472 std::cout <<
"instance symbol: " <<
new_symb.name <<
"\n\n";
473 std::cout <<
"template type: " << template_type.
pretty() <<
"\n\n";
485 if(
new_decl.member_spec().is_virtual())
488 error() <<
"invalid use of `virtual' in template declaration"
496 error() <<
"template declaration for typedef" <<
eom;
500 if(
new_decl.storage_spec().is_extern() ||
501 new_decl.storage_spec().is_auto() ||
502 new_decl.storage_spec().is_register() ||
503 new_decl.storage_spec().is_mutable())
506 error() <<
"invalid storage class specified for template field"
511 bool is_static=
new_decl.storage_spec().is_static();
Generic exception types primarily designed for use with invariants.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
virtual void make_constant(exprt &expr)
symbol_tablet & symbol_table
cpp_idt & put_into_scope(const symbolt &symbol, cpp_scopet &scope, bool is_friend=false)
cpp_scopet & current_scope()
cpp_scopet & get_parent() const
std::set< cpp_idt * > id_sett
exprt::operandst argumentst
bool has_unassigned() const
std::string template_suffix(const cpp_template_args_tct &template_args)
instantiation_stackt instantiation_stack
template_mapt template_map
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 convert_non_template_declaration(cpp_declarationt &declaration)
bool cpp_is_pod(const typet &type) const
void show_instantiation_stack(std::ostream &)
void convert(cpp_linkage_spect &)
cpp_scopet & sub_scope_for_instantiation(cpp_scopet &template_scope, const std::string &suffix)
Set up a scope as subscope of the template scope.
void elaborate_class_template(const typet &type)
elaborate class template instances
cpp_scopet & typecheck_template_parameters(template_typet &type)
std::string to_string(const typet &) override
const symbolt & 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{})
const symbolt & 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)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
bool is_true() const
Return whether the expression is a constant representing true.
bool is_false() const
Return whether the expression is a constant representing false.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool get_bool(const irep_idt &name) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
source_locationt source_location
mstreamt & result() const
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Structure type, corresponds to C style structs.
const componentst & components() const
void make_incomplete()
A struct/union may be incomplete.
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
virtual bool move(symbolt &symbol, symbolt *&new_symbol) override
Move a symbol into the symbol table.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
irep_idt pretty_name
Language-specific display name.
irep_idt irep_idt base_name
Name of module the symbol belongs to.
exprt value
Initial value of symbol.
irep_idt mode
Language mode.
void build(const template_typet &template_type, const cpp_template_args_tct &template_args)
void print(std::ostream &out) const
void apply(exprt &dest) const
The type of an expression, extends irept.
source_locationt & add_source_location()
const source_locationt & source_location() const
cpp_declarationt & to_cpp_declaration(irept &irep)
std::string cpp_type2name(const typet &type)
C++ Language Type Checking.
#define forall_expr(it, expr)
const std::string & id2string(const irep_idt &d)
const std::string integer2string(const mp_integer &n, unsigned base)
static optionalt< smt_termt > get_identifier(const exprt &expr, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_handle_identifiers, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_identifiers)
#define INVARIANT_STRUCTURED(CONDITION, TYPENAME,...)
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.