cprover
Loading...
Searching...
No Matches
cpp_typecheck.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: C++ Language Type Checking
4
5Author: Daniel Kroening, kroening@cs.cmu.edu
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_CPP_CPP_TYPECHECK_H
13#define CPROVER_CPP_CPP_TYPECHECK_H
14
15#include <util/std_code_base.h>
16
18
19#include "cpp_parse_tree.h"
20#include "cpp_scopes.h"
22#include "template_map.h"
23
24#include <list>
25#include <set>
26#include <unordered_set>
27
28bool cpp_typecheck(
29 cpp_parse_treet &cpp_parse_tree,
30 symbol_table_baset &symbol_table,
31 const std::string &module,
32 message_handlert &message_handler);
33
34bool cpp_typecheck(
35 exprt &expr,
36 message_handlert &message_handler,
37 const namespacet &ns);
38
40{
41public:
43 cpp_parse_treet &_cpp_parse_tree,
44 symbol_table_baset &_symbol_table,
45 const std::string &_module,
47
49 cpp_parse_treet &_cpp_parse_tree,
50 symbol_table_baset &_symbol_table1,
51 const symbol_table_baset &_symbol_table2,
52 const std::string &_module,
54
55 ~cpp_typecheckt() override
56 {
57 }
58
59 void typecheck() override;
60
61 // overload to use C++ syntax
62 std::string to_string(const typet &) override;
63 std::string to_string(const exprt &) override;
64
67
69 const cpp_namet &cpp_name,
71 const cpp_typecheck_fargst &fargs,
72 bool fail_with_exception=true)
73 {
74 cpp_typecheck_resolvet cpp_typecheck_resolve(*this);
75 return cpp_typecheck_resolve.resolve(
76 cpp_name, want, fargs, fail_with_exception);
77 }
78
79 void typecheck_expr(exprt &) override;
80
81 bool cpp_is_pod(const typet &type) const;
82
84 const source_locationt &source_location,
85 const exprt &object,
86 const exprt::operandst &operands);
87
88protected:
90
93
96 void convert(cpp_usingt &);
97 void convert(cpp_itemt &);
101
102 void convert_initializer(symbolt &symbol);
103 void convert_function(symbolt &symbol);
104
105 void convert_pmop(exprt &expr);
106
108
110 const cpp_declarationt &declaration,
111 const irep_idt &access,
112 struct_typet::componentst &components);
113
114 //
115 // Templates
116 //
118 const template_typet &old_type,
119 template_typet &new_type);
120
122
124
126 cpp_declarationt &declaration);
127
129 cpp_declarationt &declaration);
130
132
134
136
137 std::string class_template_identifier(
138 const irep_idt &base_name,
139 const template_typet &template_type,
140 const cpp_template_args_non_tct &partial_specialization_args);
141
143 const irep_idt &base_name,
144 const template_typet &template_type,
145 const typet &function_type);
146
148 const source_locationt &source_location,
149 const symbolt &template_symbol,
150 const cpp_template_args_non_tct &template_args);
151
152 // template instantiations
160
161 typedef std::list<instantiationt> instantiation_stackt;
163
164 void show_instantiation_stack(std::ostream &);
165
167 {
168 public:
170 instantiation_stackt &_instantiation_stack):
171 instantiation_stack(_instantiation_stack)
172 {
174 }
175
177 {
178 instantiation_stack.pop_back();
179 }
180
181 private:
183 };
184
186 const source_locationt &source_location,
187 const symbolt &template_symbol,
188 const cpp_template_args_tct &specialization_template_args,
189 const cpp_template_args_tct &full_template_args);
190
192 const typet &type);
193
195 const source_locationt &source_location,
196 const symbolt &symbol,
197 const cpp_template_args_tct &specialization_template_args,
198 const cpp_template_args_tct &full_template_args,
199 const typet &specialization = uninitialized_typet{});
200
202 const source_locationt &source_location,
203 const struct_tag_typet &type);
204
206 unsigned anon_counter;
207
209
210 std::string template_suffix(
211 const cpp_template_args_tct &template_args);
212
214 cpp_scopet &template_scope,
215 const std::string &suffix);
216
217 void
218 convert_parameters(const irep_idt &current_mode, code_typet &function_type);
219
221 const irep_idt &current_mode,
222 code_typet::parametert &parameter);
223
224 //
225 // Misc
226 //
227
228 void default_ctor(
229 const source_locationt &source_location,
230 const irep_idt &base_name,
231 cpp_declarationt &ctor) const;
232
233 void default_cpctor(
234 const symbolt&, cpp_declarationt &cpctor) const;
235
236 void default_assignop(
237 const symbolt &symbol, cpp_declarationt &cpctor);
238
240 const symbolt &symbol, cpp_declaratort &declarator);
241
242 void default_dtor(const symbolt &symb, cpp_declarationt &dtor);
243
244 codet dtor(const symbolt &symb, const symbol_exprt &this_expr);
245
247 const struct_typet::basest &bases,
248 const struct_typet::componentst &components,
249 const irept &initializers);
250
253 const struct_union_typet &struct_union_type);
254
256 const struct_union_typet &struct_union_type,
257 irept &initializers);
258
259 bool find_cpctor(const symbolt &symbol)const;
260 bool find_assignop(const symbolt &symbol)const;
261 bool find_dtor(const symbolt &symbol)const;
262
263 bool find_parent(
264 const symbolt &symb,
265 const irep_idt &base_name,
266 irep_idt &identifier);
267
268 bool get_component(
269 const source_locationt &source_location,
270 const exprt &object,
271 const irep_idt &component_name,
272 exprt &member);
273
274 void new_temporary(const source_locationt &source_location,
275 const typet &,
276 const exprt::operandst &ops,
277 exprt &temporary);
278
279 void new_temporary(const source_locationt &source_location,
280 const typet &,
281 const exprt &op,
282 exprt &temporary);
283
285 void do_not_typechecked();
286 void clean_up();
287
289 const struct_typet &from,
290 const irep_idt &access,
291 struct_typet &to,
292 std::set<irep_idt> &bases,
293 std::set<irep_idt> &vbases,
294 bool is_virtual);
295
296 bool cast_away_constness(const typet &t1,
297 const typet &t2) const;
298
299 void do_virtual_table(const symbolt &symbol);
300
301 // we need to be able to delay the typechecking
302 // of method bodies to handle methods with
303 // bodies in the class definition
305 {
306 public:
308 symbolt *_method_symbol,
309 const template_mapt &_template_map,
310 const instantiation_stackt &_instantiation_stack):
311 method_symbol(_method_symbol),
312 template_map(_template_map),
313 instantiation_stack(_instantiation_stack)
314 {
315 }
316
320 };
321
322 typedef std::list<method_bodyt> method_bodiest;
323 std::set<irep_idt> methods_seen;
325
326 void add_method_body(symbolt *_method_symbol);
327
328 bool builtin_factory(const irep_idt &) override;
329
330 // types
331
332 void typecheck_type(typet &) override;
333
335 template_typet &type);
336
338 void check_fixed_size_array(typet &type);
339 void typecheck_enum_type(typet &type);
340
341 // determine the scope into which a tag goes
342 // (enums, structs, union, classes)
344 const irep_idt &_base_name,
345 bool has_body,
346 bool tag_only_declaration);
347
349 const symbolt &symbol,
350 const cpp_declarationt &declaration,
351 cpp_declaratort &declarator,
352 struct_typet::componentst &components,
353 const irep_idt &access,
354 bool is_static,
355 bool is_typedef,
356 bool is_mutable);
357
359 symbolt &symbol,
360 cpp_declarationt &cpp_declaration);
361
363 void typecheck_compound_body(symbolt &symbol);
365 {
367 }
368 void typecheck_enum_body(symbolt &symbol);
371 void add_anonymous_members_to_scope(const symbolt &struct_union_symbol);
372
374 irept &initializers,
375 const code_typet &type,
376 exprt &value);
377
378 static bool has_const(const typet &type);
379 static bool has_volatile(const typet &type);
380 static bool has_auto(const typet &type);
381
383 const symbolt &compound_symbol,
385 irept &initializers,
386 const typet &method_qualifier,
387 exprt &value);
388
390 const symbolt &compound_symbol,
391 code_typet &method_type,
392 const typet &method_qualifier);
393
394 // for function overloading
396
397 void zero_initializer(
398 const exprt &object,
399 const typet &type,
400 const source_locationt &source_location,
401 exprt::operandst &ops);
402
403 // code conversion
404 void typecheck_code(codet &) override;
407 void typecheck_decl(codet &) override;
408 void typecheck_block(code_blockt &) override;
409 void typecheck_ifthenelse(code_ifthenelset &) override;
410 void typecheck_while(code_whilet &) override;
411 void typecheck_switch(codet &) override;
412
414
416 cpp_destructor(const source_locationt &source_location, const exprt &object);
417
418 // expressions
420 void typecheck_expr_main(exprt &) override;
421 void typecheck_expr_member(exprt &) override;
422 void typecheck_expr_ptrmember(exprt &) override;
429 void typecheck_expr_trinary(if_exprt &) override;
433 void typecheck_expr_address_of(exprt &) override;
434 void typecheck_expr_dereference(exprt &) override;
439 void typecheck_expr_sizeof(exprt &) override;
444 void typecheck_expr_typecast(exprt &) override;
445 void typecheck_expr_index(exprt &) override;
447 void typecheck_expr_comma(exprt &) override;
448
449 void
451
453 bool overloadable(const exprt &);
454
456
459
461
462public:
463 //
464 // Type Conversions
465 //
466
468 const exprt &expr, exprt &new_expr) const;
469
471 const exprt &expr, exprt &new_expr) const;
472
474 const exprt &expr, exprt &new_expr) const;
475
477 const exprt &expr, const typet&, exprt &new_expr) const;
478
480 const exprt &expr, exprt &new_expr) const;
481
483 const exprt &expr, exprt &new_expr) const;
484
486 const exprt &expr, const typet &type, exprt &new_expr) const;
487
489 const exprt &expr, const typet &type, exprt &new_expr) const;
490
492 const exprt &expr, const typet &type, exprt &new_expr) const;
493
495 const exprt &expr, const typet &type, exprt &new_expr);
496
498 const exprt &expr, const typet &type, exprt &new_expr);
499
501 const exprt &expr, exprt &new_expr) const;
502
504 const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank);
505
507 const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank);
508
510 const exprt &expr, const typet &type) const;
511
513 const exprt &expr, const typet &type, unsigned &rank) const;
514
516 exprt expr, const typet &type, exprt &new_expr, unsigned &rank);
517
519 const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank);
520
522 const exprt &expr, const typet &type, unsigned &rank);
523
525 const exprt &expr, const typet &type, exprt &new_expr);
526
527 void reference_initializer(exprt &expr, const typet &type);
528
529 void implicit_typecast(exprt &expr, const typet &type) override;
530
531 void get_bases(const struct_typet &type,
532 std::set<irep_idt> &set_bases) const;
533
534 void get_virtual_bases(const struct_typet &type,
535 std::list<irep_idt> &vbases) const;
536
537 bool subtype_typecast(
538 const struct_typet &from,
539 const struct_typet &to) const;
540
542 exprt &expr,
543 const typet &dest_type);
544
545 // the C++ typecasts
546
547 bool const_typecast(
548 const exprt &expr,
549 const typet &type,
550 exprt &new_expr);
551
552 bool dynamic_typecast(
553 const exprt &expr,
554 const typet &type,
555 exprt &new_expr);
556
558 const exprt &expr,
559 const typet &type,
560 exprt &new_expr,
561 bool check_constantness=true);
562
563 bool static_typecast(
564 const exprt &expr,
565 const typet &type,
566 exprt &new_expr,
567 bool check_constantness=true);
568
569 bool contains_cpp_name(const exprt &);
570
571private:
572 typedef std::list<irep_idt> dynamic_initializationst;
574 bool disable_access_control; // Disable protect and private
575 std::unordered_set<irep_idt> deferred_typechecking;
577};
578
579#endif // CPROVER_CPP_CPP_TYPECHECK_H
ANSI-C Language Type Checking.
A base class for relations, i.e., binary predicates whose two operands have the same type.
Definition std_expr.h:707
A codet representing sequential composition of program statements.
Definition std_code.h:130
codet representation of an if-then-else statement.
Definition std_code.h:460
Base type of functions.
Definition std_types.h:539
codet representing a while statement.
Definition std_code.h:610
Data structure for representing an arbitrary statement in a program.
exprt resolve(const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
instantiation_stackt & instantiation_stack
instantiation_levelt(instantiation_stackt &_instantiation_stack)
cpp_template_args_tct full_template_args
bool find_parent(const symbolt &symb, const irep_idt &base_name, irep_idt &identifier)
void default_assignop(const symbolt &symbol, cpp_declarationt &cpctor)
Generate declaration of the implicit default assignment operator.
void typecheck_expr_typecast(exprt &) override
void typecheck_compound_body(symbolt &symbol)
void do_virtual_table(const symbolt &symbol)
void static_and_dynamic_initialization()
Initialization of static objects:
std::string template_suffix(const cpp_template_args_tct &template_args)
std::set< irep_idt > methods_seen
void typecheck_side_effect_assignment(side_effect_exprt &) override
bool implicit_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
implicit conversion sequence
bool reference_compatible(const exprt &expr, const typet &type, unsigned &rank) const
Reference-compatible.
optionalt< codet > cpp_destructor(const source_locationt &source_location, const exprt &object)
bool standard_conversion_floating_point_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Floating-point conversion.
void put_compound_into_scope(const struct_union_typet::componentt &component)
std::string class_template_identifier(const irep_idt &base_name, const template_typet &template_type, const cpp_template_args_non_tct &partial_specialization_args)
void typecheck_type(typet &) override
void convert_anon_struct_union_member(const cpp_declarationt &declaration, const irep_idt &access, struct_typet::componentst &components)
void typecheck_switch(codet &) override
void explicit_typecast_ambiguity(exprt &)
void typecheck_compound_body(struct_union_typet &) override
instantiation_stackt instantiation_stack
void full_member_initialization(const struct_union_typet &struct_union_type, irept &initializers)
Build the full initialization list of the constructor.
bool contains_cpp_name(const exprt &)
void typecheck_decl(codet &) override
template_mapt template_map
bool reinterpret_typecast(const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true)
std::string function_template_identifier(const irep_idt &base_name, const template_typet &template_type, const typet &function_type)
void typecheck_enum_type(typet &type)
void convert_pmop(exprt &expr)
void typecheck_expr_sizeof(exprt &) override
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)
static bool has_const(const typet &type)
dynamic_initializationst dynamic_initializations
bool standard_conversion_boolean(const exprt &expr, exprt &new_expr) const
Boolean conversion.
void typecheck_code(codet &) override
std::list< method_bodyt > method_bodiest
void convert_template_declaration(cpp_declarationt &declaration)
bool standard_conversion_pointer(const exprt &expr, const typet &type, exprt &new_expr)
Pointer conversion.
void convert_function(symbolt &symbol)
void typecheck_expr_explicit_typecast(exprt &)
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 implicit_typecast(exprt &expr, const typet &type) override
void typecheck_cast_expr(exprt &)
void salvage_default_arguments(const template_typet &old_type, template_typet &new_type)
void default_dtor(const symbolt &symb, cpp_declarationt &dtor)
Note:
bool standard_conversion_integral_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Integral conversion.
bool standard_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
Standard Conversion Sequence.
void typecheck_expr_dereference(exprt &) override
void convert_non_template_declaration(cpp_declarationt &declaration)
irep_idt current_linkage_spec
bool standard_conversion_qualification(const exprt &expr, const typet &, exprt &new_expr) const
Qualification conversion.
unsigned anon_counter
void typecheck_function_template(cpp_declarationt &declaration)
typecheck function templates
unsigned template_counter
void typecheck_member_initializer(codet &)
bool check_component_access(const struct_union_typet::componentt &component, const struct_union_typet &struct_union_type)
void typecheck_side_effect_function_call(side_effect_expr_function_callt &) override
std::list< instantiationt > instantiation_stackt
void typecheck_member_function(const symbolt &compound_symbol, struct_typet::componentt &component, irept &initializers, const typet &method_qualifier, exprt &value)
bool cpp_is_pod(const typet &type) const
void convert_initializer(symbolt &symbol)
Initialize an object with a value.
void check_fixed_size_array(typet &type)
check that an array has fixed size
void default_cpctor(const symbolt &, cpp_declarationt &cpctor) const
Generate code for implicit default copy constructor.
bool standard_conversion_floating_point_promotion(const exprt &expr, exprt &new_expr) const
Floating-point-promotion conversion.
bool find_assignop(const symbolt &symbol) const
bool get_component(const source_locationt &source_location, const exprt &object, const irep_idt &component_name, exprt &member)
bool standard_conversion_floating_integral_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Floating-integral conversion.
bool const_typecast(const exprt &expr, const typet &type, exprt &new_expr)
void new_temporary(const source_locationt &source_location, const typet &, const exprt::operandst &ops, exprt &temporary)
void typecheck_compound_type(struct_union_typet &) override
void add_anonymous_members_to_scope(const symbolt &struct_union_symbol)
void typecheck_expr_trinary(if_exprt &) override
void typecheck_class_template_member(cpp_declarationt &declaration)
typecheck class template members; these can be methods or static members
codet dtor(const symbolt &symb, const symbol_exprt &this_expr)
produces destructor code for a class object
void typecheck_try_catch(codet &)
void get_virtual_bases(const struct_typet &type, std::list< irep_idt > &vbases) const
void typecheck_expr_rel(binary_relation_exprt &) override
void typecheck_expr_reference_to(exprt &)
void show_instantiation_stack(std::ostream &)
bool standard_conversion_function_to_pointer(const exprt &expr, exprt &new_expr) const
Function-to-pointer conversion.
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 convert(cpp_linkage_spect &)
bool standard_conversion_array_to_pointer(const exprt &expr, exprt &new_expr) const
Array-to-pointer conversion.
std::unordered_set< irep_idt > deferred_typechecking
bool dynamic_typecast(const exprt &expr, const typet &type, exprt &new_expr)
void add_method_body(symbolt *_method_symbol)
void check_member_initializers(const struct_typet::basest &bases, const struct_typet::componentst &components, const irept &initializers)
Check a constructor initialization-list.
void typecheck_expr_binary_arithmetic(exprt &) override
void typecheck_expr_delete(exprt &)
method_bodiest method_bodies
void default_assignop_value(const symbolt &symbol, cpp_declaratort &declarator)
Generate code for the implicit default assignment operator.
cpp_scopet & sub_scope_for_instantiation(cpp_scopet &template_scope, const std::string &suffix)
Set up a scope as subscope of the template scope.
cpp_typecheckt(cpp_parse_treet &_cpp_parse_tree, symbol_table_baset &_symbol_table, const std::string &_module, message_handlert &message_handler)
void typecheck_ifthenelse(code_ifthenelset &) override
cpp_scopet & tag_scope(const irep_idt &_base_name, bool has_body, bool tag_only_declaration)
void typecheck_compound_bases(struct_typet &type)
optionalt< codet > cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
void typecheck_expr_main(exprt &) override
Called after the operands are done.
void elaborate_class_template(const typet &type)
elaborate class template instances
static bool has_auto(const typet &type)
bool builtin_factory(const irep_idt &) override
static bool has_volatile(const typet &type)
bool operator_is_overloaded(exprt &)
bool user_defined_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
User-defined conversion sequence.
~cpp_typecheckt() override
bool standard_conversion_lvalue_to_rvalue(const exprt &expr, exprt &new_expr) const
Lvalue-to-rvalue conversion.
irep_idt function_identifier(const typet &type)
for function overloading
bool cast_away_constness(const typet &t1, const typet &t2) const
void typecheck() override
typechecking main method
void typecheck_expr_new(exprt &)
codet convert_anonymous_union(cpp_declarationt &declaration)
void add_implicit_dereference(exprt &)
void typecheck_expr_cpp_name(exprt &, const cpp_typecheck_fargst &)
void typecheck_expr(exprt &) override
void typecheck_friend_declaration(symbolt &symbol, cpp_declarationt &cpp_declaration)
void add_this_to_method_type(const symbolt &compound_symbol, code_typet &method_type, const typet &method_qualifier)
void typecheck_expr_side_effect(side_effect_exprt &) override
void typecheck_expr_comma(exprt &) override
bool static_typecast(const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true)
bool subtype_typecast(const struct_typet &from, const struct_typet &to) const
void convert_parameter(const irep_idt &current_mode, code_typet::parametert &parameter)
void typecheck_enum_body(symbolt &symbol)
void typecheck_expr_explicit_constructor_call(exprt &)
bool standard_conversion_integral_promotion(const exprt &expr, exprt &new_expr) const
Integral-promotion conversion.
bool find_cpctor(const symbolt &symbol) const
void typecheck_function_expr(exprt &, const cpp_typecheck_fargst &)
cpp_scopet & typecheck_template_parameters(template_typet &type)
void move_member_initializers(irept &initializers, const code_typet &type, exprt &value)
void convert(cpp_declaratort &)
void typecheck_method_application(side_effect_expr_function_callt &)
std::string to_string(const typet &) override
bool disable_access_control
void elaborate_class_template(const source_locationt &source_location, const struct_tag_typet &type)
void typecheck_expr_this(exprt &)
void typecheck_expr_throw(exprt &)
bool overloadable(const exprt &)
void typecheck_block(code_blockt &) override
std::list< irep_idt > dynamic_initializationst
void convert_parameters(const irep_idt &current_mode, code_typet &function_type)
void typecheck_while(code_whilet &) override
const struct_typet & this_struct_type()
void typecheck_expr_index(exprt &) override
void typecheck_side_effect_inc_dec(side_effect_exprt &)
void make_ptr_typecast(exprt &expr, const typet &dest_type)
void zero_initializer(const exprt &object, const typet &type, const source_locationt &source_location, exprt::operandst &ops)
bool standard_conversion_pointer_to_member(const exprt &expr, const typet &type, exprt &new_expr)
Pointer-to-member conversion.
void typecheck_class_template(cpp_declarationt &declaration)
cpp_parse_treet & cpp_parse_tree
void typecheck_function_call_arguments(side_effect_expr_function_callt &) 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{})
void typecheck_expr_ptrmember(exprt &) override
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)
void default_ctor(const source_locationt &source_location, const irep_idt &base_name, cpp_declarationt &ctor) const
Generate code for implicit default constructors.
exprt resolve(const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
cpp_scopest cpp_scopes
void reference_initializer(exprt &expr, const typet &type)
A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows:
void get_bases(const struct_typet &type, std::set< irep_idt > &set_bases) const
void convert_template_function_or_member_specialization(cpp_declarationt &declaration)
void convert_class_template_specialization(cpp_declarationt &declaration)
bool reference_binding(exprt expr, const typet &type, exprt &new_expr, unsigned &rank)
Reference binding.
void typecheck_expr_address_of(exprt &) override
bool find_dtor(const symbolt &symbol) const
void typecheck_expr_function_identifier(exprt &) override
void typecheck_expr_member(exprt &) override
bool reference_related(const exprt &expr, const typet &type) const
Reference-related.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:39
Base class for all expressions.
Definition expr.h:56
std::vector< exprt > operandst
Definition expr.h:58
The trinary if-then-else operator.
Definition std_expr.h:2323
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition irep.h:372
message_handlert * message_handler
Definition message.h:439
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
A side_effect_exprt representation of a function call side effect.
Definition std_code.h:1692
An expression containing a side effect.
Definition std_code.h:1450
A struct tag type, i.e., struct_typet with an identifier.
Definition std_types.h:449
Structure type, corresponds to C style structs.
Definition std_types.h:231
std::vector< baset > basest
Definition std_types.h:259
Base type for structs and unions.
Definition std_types.h:62
std::vector< componentt > componentst
Definition std_types.h:140
Expression to hold a symbol (variable)
Definition std_expr.h:113
The symbol table base class interface.
Symbol table entry.
Definition symbol.h:28
The type of an expression, extends irept.
Definition type.h:29
C++ Parser.
C++ Language Type Checking.
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
C++ Language Type Checking.
nonstd::optional< T > optionalt
Definition optional.h:35
#define UNREACHABLE
This should be used to mark dead code.
Definition invariant.h:525
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
Definition std_expr.cpp:77
instantiation_stackt instantiation_stack
method_bodyt(symbolt *_method_symbol, const template_mapt &_template_map, const instantiation_stackt &_instantiation_stack)
C++ Language Type Checking.