Documentation of the reflection API

Builtin types

For each kind of expression/declaration/type/statement, a type with the same name as the enumerator constant exist.

Expressions

using expr = ...;

enum class expr_kind {
  operator_expr,
  call_expr,
  cast_expr,
  new_expr,
  delete_expr,
  field_expr,
  method_call_expr,
  literal_expr,
  decl_ref_expr,
  construct_expr,
  construct_aggregate_expr,
  destruct_expr,
  list_expr,
  lambda_expr,
  throw_expr,
  this_expr,
  typeid_expr,
  overload_expr,
  ternary_expr,
  refl_expr,
  materialize_temporary_expr,
  expansion_expr,
  fold_expr,
  requires_expr,
  concept_expr
};

Statements

using stmt = ...; 

enum class stmt_kind {
  decl_stmt,
  return_stmt,
  if_stmt,
  compound_stmt,
  expr_stmt,
  for_stmt,
  for_range_stmt,
  while_stmt,
  switch_stmt,
  break_stmt,
  continue_stmt,
  case_stmt,
  goto_stmt,
  try_stmt,
  catch_stmt
};

Types

using type = ...;

enum class type_kind {
  core_type,
  pointer_type,
  reference_type,
  member_pointer_type,
  array_type,
  function_type,
  template_type,
  deduced_type,
  alias_template_type,
  method_type,
  class_template_type,
  alias_type,
  dependent_name_type,
  expansion_type,
  class_type,
  enum_type,
  template_parameter_type
};

Declarations

using decl = ...;

enum class decl_kind {
  namespace_decl,
  var_decl,
  function_decl,
  method_decl,
  parameter_var_decl,
  constructor_decl,
  enum_constant_decl,
  class_template_decl,
  class_template_spec_decl,
  function_template_decl,
  function_template_spec_decl,
  method_template_decl,
  alias_template_decl,
  field_decl,
  concept_decl,
  var_template_decl,
  var_template_spec_decl,
  using_decl,
  alias_type_decl,
  friend_decl,
  class_decl,
  enum_decl,
  template_parameter_decl
};

Type properties

static constexpr type auto_ty = ...;
static constexpr type decltype_auto_ty = ...;

consteval type_kind kind(type);
consteval unsigned long hash(type);
consteval unsigned long size_of(type);
consteval unsigned long align_of(type);
consteval type canonical(type);
consteval bool identity(type, type);
consteval bool is_dependent(type);
consteval bool is_deep_const(type);
consteval bool is_complete(type);
consteval bool is_structural(type);
consteval bool is_signed(type);
consteval bool is_unsigned(type);
consteval bool is_integral(type);
consteval bool is_floating_point(type);
consteval bool is_array(type);
consteval bool is_enum(type);
consteval bool is_union(type);
consteval bool is_class(type);
consteval bool is_function(type);
consteval bool is_pointer(type);
consteval bool is_member_object_pointer(type);
consteval bool is_member_function_pointer(type);
consteval bool is_const(type);
consteval type remove_const(type);
consteval bool is_reference(type);
consteval bool is_lvalue_reference(type);
consteval bool is_rvalue_reference(type);
consteval type remove_reference(type);
consteval bool is_reflection(type);
consteval bool is_base_of(type, type);
consteval bool is_derived_from(type, type);
consteval unsigned long offset_of(class_decl, field_decl);
consteval unsigned long offset_of(class_decl, class_decl);
consteval bool is_aggregate(type);
consteval bool is_copy_constructible(type);
consteval bool is_move_constructible(type);
consteval bool is_trivially_move_constructible(type);
consteval bool is_nothrow_move_constructible(type);
consteval bool is_assignable(type, type);
consteval bool is_convertible(type, type);
consteval bool is_copy_assignable(type);
consteval bool is_destructible(type);
consteval bool is_trivially_destructible(type);
consteval bool is_default_constructible(type);
consteval bool is_constructible(type, type_list);

template <class Fn> 
consteval decltype(auto) visit(Fn&&, type);

consteval type pointee(pointer_type);
consteval type return_type(function_type);
consteval type_list parameters(function_type);
consteval type_iterator begin(const type_list &);
consteval type_iterator end(const type_list &);
consteval unsigned long size(type_list);
consteval type element(array_type);
consteval unsigned long integer_extent(array_type);
consteval expr extent(array_type);
consteval bool is_sizeless(array_type);
consteval class_decl decl_of(class_template_type);
consteval class_template_decl primary(class_template_type);
consteval template_arguments arguments(class_template_type);
consteval template_argument_iterator begin(const template_arguments &);
consteval template_argument_iterator end(const template_arguments &);
consteval unsigned long size(template_arguments);
consteval template_argument_kind kind(template_argument);
consteval type aliased(alias_type);
consteval type aliased(alias_template_type);
consteval alias_template_decl decl_of(alias_template_type);
consteval template_arguments arguments(alias_template_type);
consteval bool is_instance_of(type, class_template_decl);
consteval class_type object(member_pointer_type);
consteval type pointee(member_pointer_type);
consteval type expanded(expansion_type);

Type construction

consteval type make_const(type);
consteval type make_const(type, bool ConstIfTrue);
consteval pointer_type make_pointer(type);
consteval reference_type make_lvalue_reference(type);
consteval reference_type make_rvalue_reference(type);
consteval function_type make_function(type ReturnType, type_list ParamTypes);
consteval array_type make_array(type Element, expr Extent);
consteval array_type make_array(type Element, unsigned long Extent);
consteval array_type make_sizeless_array(type);
consteval member_pointer_type make_member_pointer(class_type, type);
consteval expansion_type make_expansion(type);
consteval template_type instantiate(class_template_decl, template_arguments);

Statements properties

consteval stmt_kind kind(stmt);
consteval unsigned long hash(stmt);
consteval source_location location(stmt);

template <class Fn> 
consteval decltype(auto) visit(Fn&&, stmt);

consteval stmt_iterator begin(compound_stmt);
consteval stmt_iterator end(compound_stmt);
consteval expr value_of(return_stmt);
consteval bool has_value(return_stmt);
consteval expr condition(if_stmt);
consteval bool has_else_branch(if_stmt);
consteval stmt else_branch(if_stmt);
consteval bool is_if_consteval(if_stmt);
consteval bool is_if_constexpr(if_stmt);
consteval expr condition(switch_stmt);
consteval bool has_condition_var(if_stmt);
consteval var_decl condition_var(if_stmt);
consteval bool has_condition_var(while_stmt);
consteval var_decl condition_var(while_stmt);
consteval bool has_condition_var(for_stmt);
consteval var_decl condition_var(for_stmt);
consteval expr condition(for_stmt);
consteval expr step(for_stmt);
consteval bool has_step(for_stmt);
consteval expr range_expr(for_range_stmt);
consteval var_decl loop_var(for_range_stmt);
consteval stmt prelude(for_stmt);
consteval expr condition(while_stmt);
consteval bool is_do_while(while_stmt);
consteval expr value_of(case_stmt);
consteval bool is_default(case_stmt);
consteval catch_clauses catchs(try_stmt);
consteval catch_clauses_iterator begin(catch_clauses);
consteval catch_clauses_iterator end(catch_clauses);

Expressions properties

consteval expr_kind kind(expr);
consteval unsigned long hash(expr);
consteval type type_of(expr);
consteval expr_list children(expr);
consteval expr_iterator begin(const expr_list &);
consteval expr_iterator end(const expr_list &);
consteval unsigned long size(expr_list);
consteval expr child(expr, unsigned long);
consteval source_location location(expr);
// remove any implicit casts around the operand
consteval expr strip_implicit(expr);
consteval expr_list strip_implicit(expr_list);
consteval bool is_move(expr);
consteval bool is_assign(expr);
consteval bool is_lvalue_to_rvalue_cast(expr);
consteval bool is_implicit_cast(expr);
consteval bool cannot_throw(expr);

template <class Fn> 
consteval decltype(auto) visit(Fn&&, expr);

consteval expr callee(call_expr);
consteval function_decl callee_decl(call_expr);
consteval expr_list arguments(call_expr);
consteval expr argument(call_expr, unsigned long);
consteval decl decl_of(decl_ref_expr);
// whether or not a reference is dependent or was resolved to a declaration
consteval bool is_resolved(decl_ref_expr);

consteval operator_kind op(operator_expr);
consteval bool is_user_defined(operator_expr);
consteval function_decl callee(operator_expr);
consteval unsigned long arity(operator_expr);
consteval expr_list operands(operator_expr);
consteval expr operand(operator_expr, unsigned long);
consteval bool is_compound_assign(operator_kind);
consteval bool is_arithmetic(operator_kind);
consteval bool is_comparison(operator_kind);
consteval operator_kind compound_equivalent(operator_kind);
consteval operator_kind noncompound_equivalent(operator_kind);
consteval bool is_prefix(operator_kind);
consteval bool is_suffix(operator_kind);

consteval type allocated(new_expr);
consteval bool has_initializer(new_expr);
consteval expr initializer(new_expr);
consteval bool is_array_form(new_expr);
consteval bool is_user_defined(new_expr);
consteval function_decl callee(new_expr);
consteval expr array_extent(new_expr);
consteval expr operand(delete_expr);
consteval bool is_array_form(delete_expr);
consteval bool is_user_defined(delete_expr);
consteval function_decl callee(delete_expr);
consteval constructor_decl callee(construct_expr);
consteval bool is_user_defined(construct_expr);
consteval constructor_initializers initializers(construct_aggregate_expr);
consteval bool is_user_defined(destruct_expr);
consteval method_decl callee(destruct_expr);
consteval field_decl field(field_expr);
consteval bool is_resolved(field_expr);
consteval expr operand(throw_expr);
consteval bool has_operand(throw_expr);
consteval type type_operand(typeid_expr);
consteval expr expr_operand(typeid_expr);
consteval bool has_type_operand(typeid_expr);
consteval bool has_expr_operand(typeid_expr);
template <class T> 
consteval T value_as(literal_expr);
consteval expr condition(ternary_expr);
consteval expr first(ternary_expr);
consteval expr second(ternary_expr);
consteval cast_kind kind(cast_expr);
consteval template_arguments arguments(concept_expr);
consteval concept_decl concept_of(concept_expr);
consteval lambda_captures captures(lambda_expr);
consteval lambda_captures_iterator begin(lambda_captures);
consteval lambda_captures_iterator end(lambda_captures);
consteval bool is_reference(lambda_capture);
consteval bool is_copy(lambda_capture);

Statements properties

consteval stmt_kind kind(stmt);
consteval unsigned long hash(stmt);
consteval source_location location(stmt);

consteval stmt_iterator begin(compound_stmt);
consteval stmt_iterator end(compound_stmt);
consteval expr value_of(return_stmt);
consteval bool has_value(return_stmt);
consteval expr condition(if_stmt);
consteval bool has_else_branch(if_stmt);
consteval stmt else_branch(if_stmt);
consteval bool is_if_consteval(if_stmt);
consteval bool is_if_constexpr(if_stmt);
consteval expr condition(switch_stmt);
consteval bool has_condition_var(if_stmt);
consteval var_decl condition_var(if_stmt);
consteval bool has_condition_var(while_stmt);
consteval var_decl condition_var(while_stmt);
consteval bool has_condition_var(for_stmt);
consteval var_decl condition_var(for_stmt);
consteval expr condition(for_stmt);
consteval expr step(for_stmt);
consteval bool has_step(for_stmt);
consteval expr range_expr(for_range_stmt);
consteval var_decl loop_var(for_range_stmt);
consteval stmt prelude(for_stmt);
consteval expr condition(while_stmt);
consteval bool is_do_while(while_stmt);
consteval expr value_of(case_stmt);
consteval bool is_default(case_stmt);
consteval catch_clauses catchs(try_stmt);
consteval catch_clauses_iterator begin(catch_clauses);
consteval catch_clauses_iterator end(catch_clauses);

Name and identifier

consteval bool is_identifier(name);
consteval bool is_operator(name);
consteval bool is_constructor(name);
consteval bool is_destructor(name);
consteval bool is_conversion(name);
consteval name conversion_name(type);
consteval identifier cat(identifier, unsigned long);
consteval identifier cat(identifier, identifier);

Declarations properties

consteval decl_kind kind(decl);
consteval unsigned long hash(decl);
consteval name name_of(decl);
consteval identifier identifier_of(decl);
consteval source_location location(decl);
consteval bool is_function(decl);
consteval bool is_method(decl);
consteval decl parent(decl);
consteval namespace_decl parent_namespace(decl);
consteval access access_specifier(decl);
consteval decl_iterator begin(const decl_list &);
consteval decl_iterator end(const decl_list &);
consteval unsigned long size(decl_list);

template <class Fn> 
consteval decltype(auto) visit(Fn&&, decl);

Function

consteval type return_type(function_decl);
consteval type_list parameters_types(function_decl);
consteval function_type type_of(function_decl);

// Returns a pointer or reference to the function if it is convertible to T, emit an error if not
template <class T> 
consteval T value_as(function_decl);

// Returns a range of function parameter (including the object parameter, even if implicit)
consteval function_parameters parameters(function_decl);

// Same as parameters, but exclude the object parameter if there is one
consteval function_parameters inner_parameters(function_decl);

consteval compound_stmt body(function_decl);
consteval bool is_noexcept(function_decl);
consteval bool is_deleted(function_decl);
consteval bool is_defined(function_decl);
consteval bool is_constexpr(function_decl);
consteval bool is_consteval(function_decl);
consteval bool has_c_linkage(function_decl);

consteval parameter_var_decl_iterator begin(function_parameters);
consteval parameter_var_decl_iterator end(function_parameters);
consteval unsigned long size(function_parameters);
consteval unsigned long index(parameter_var_decl);
consteval bool has_default_initializer(parameter_var_decl);
consteval expr default_initializer(parameter_var_decl);
consteval bool is_pack(parameter_var_decl);
consteval bool is_pack_element(parameter_var_decl);

// Returns the declaration this class was instantiated from, or the argument if it was not
consteval function_decl pattern(function_decl);

Class

consteval field_list fields(class_decl);
consteval field_list_iterator begin(field_list);
consteval field_list_iterator end(field_list);
consteval unsigned long size(field_list);
consteval method_list methods(class_decl);
consteval method_list_iterator begin(method_list);
consteval method_list_iterator end(method_list);
consteval decl_list children(class_decl);
consteval lookup_result lookup(class_decl, name);
consteval bool is_overload_set(const lookup_result &);
consteval bool is_single_decl(const lookup_result &);

static constexpr exclude_bases_t exclude_bases;
consteval lookup_result lookup(class_decl, name, exclude_bases_t);

// Returns the declaration from which the class was instantiated, or the operand if it wasn't
consteval class_decl pattern(class_decl);

consteval bool is_union(class_decl);
consteval bool is_abstract(class_decl);
consteval bool is_polymorphic(class_decl);
consteval bool is_final(class_decl);
consteval method_decl destructor(class_decl);
consteval bool is_defined(class_decl);
consteval base_classes bases(class_decl);
consteval base_class_iterator begin(const base_classes &);
consteval base_class_iterator end(const base_classes &);
consteval unsigned long size(const base_classes&);
consteval access access_specifier(base_class);
consteval bool is_virtual(base_class);
consteval type type_of(base_class);

Non-static data members (fields)

consteval type type_of(field_decl);
consteval class_decl parent(field_decl);
consteval bool is_mutable(field_decl);
consteval unsigned long index(field_decl);
consteval bool is_bitfield(field_decl);
consteval unsigned long bits_size(field_decl);
consteval bool has_default_initializer(field_decl);
consteval expr default_initializer(field_decl);

Non-static member functions (methods)

consteval bool is_virtual(method_decl);
consteval bool is_pure_virtual(method_decl);
consteval bool is_static(method_decl);
consteval class_decl parent(method_decl);
consteval type object_type(method_decl);
consteval bool is_explicit(method_decl);
consteval bool is_conversion(method_decl);

consteval bool is_explicit(constructor_decl);
consteval constructor_initializers initializers(constructor_decl);
consteval constructor_initializer_iterator begin(const constructor_initializers &);
consteval constructor_initializer_iterator end(const constructor_initializers &);
consteval void append(constructor_initializers &, field_decl, expr);
consteval void append(constructor_initializers &, type, expr);
consteval bool is_base(constructor_initializer);
consteval type base(constructor_initializer);
consteval bool is_field(constructor_initializer);
consteval field_decl field(constructor_initializer);
consteval expr value_of(constructor_initializer);
consteval source_location location(constructor_initializer);

Function template

consteval template_parameters template_parameters_of(function_template_decl);
consteval expr_list constraints(function_template_decl);
consteval function_decl instantiate(function_template_decl, template_arguments);
consteval bool is_instance_of(function_decl, function_template_decl);
consteval template_arguments arguments(function_template_spec_decl);
consteval function_template_decl template_of(function_template_spec_decl);

Enum

consteval type underlying_type(enum_decl);
consteval bool is_scoped(enum_decl);
consteval enum_constants constants(enum_decl);
consteval enum_constant_iterator begin(enum_constants);
consteval enum_constant_iterator end(enum_constants);
consteval unsigned long size(enum_constants);
consteval expr value_of(enum_constant_decl);
consteval lookup_result lookup(enum_decl, name);
consteval decl_list children(enum_decl);

Variable

consteval bool has_initializer(var_decl);
consteval expr initializer(var_decl);
consteval type type_of(var_decl);
consteval bool is_static(var_decl);
consteval bool is_constexpr(var_decl);

// Returns the value of V if V is convertible to T, and V is constexpr 
template <class T> 
consteval T value_as(var_decl V);

Class template (and specialization)

consteval template_parameters template_parameters_of(class_template_decl);
consteval unsigned long size(template_parameters);
consteval template_parameters_iterator begin(template_parameters);
consteval template_parameters_iterator end(template_parameters);
consteval template_argument_kind kind(template_parameter_decl);
consteval bool is_pack(template_parameter_decl);
consteval type type_of(template_parameter_decl);
consteval expr_list constraints(class_template_decl);

// Returns the primary template of a specialization
consteval class_template_decl template_of(class_template_spec_decl);

Namespace

consteval lookup_result lookup(namespace_decl, name);
consteval decl_list children(namespace_decl);

Misc

consteval expr constraint(concept_decl);
consteval bool satisfy(template_arguments, concept_decl);
consteval bool satisfy(type, concept_decl);
consteval template_parameters template_parameters_of(var_template_decl);
consteval template_arguments arguments(var_template_spec_decl);
consteval template_parameters template_parameters_of(var_template_spec_decl);

consteval overload_set_iterator begin(const overload_set &);
consteval overload_set_iterator end(const overload_set &);
consteval unsigned long size(const overload_set &);
consteval bool contains(overload_set, function_decl);

Statements construction

consteval var_decl append_var(function_builder &, identifier, type);
consteval var_decl append_var(function_builder &, identifier, type, expr);
consteval return_stmt append_return(function_builder &, expr);
consteval return_stmt append_return(function_builder &);
consteval void append_expr(function_builder &, expr);

template <class Fn> 
consteval compound_stmt append_compound(function_builder &, Fn Ctor);

template <class Fn> 
consteval if_stmt append_if(function_builder &, expr, Fn Ctor);

template <class Fn1, class Fn2> 
consteval if_stmt append_if(function_builder &, expr, Fn1 IfCtor, Fn2 Elector);

template <class Fn> 
consteval if_stmt append_if_consteval(function_builder &, Fn);

template <class Fn1, class Fn2> 
consteval if_stmt append_if_consteval(function_builder &, Fn1 IfCtor, Fn2 ElseCtor);

template <class Fn> 
consteval while_stmt append_while(function_builder &, expr, Fn);

template <class Fn> 
consteval void append_for(function_builder &, const for_init &, expr, expr, type-parameter-0-0);

// append a variable declaration to the for init statement
consteval var_decl append_var(for_init &, identifier, type, expr);

template <class Fn> 
consteval switch_stmt append_switch(function_builder &, expr, Fn Ctor);

consteval case_stmt append_case(function_builder &, expr);
consteval case_stmt append_default(function_builder &);
consteval break_stmt append_break(function_builder &);

Declarations construction

template <class Fn> 
consteval function_decl append_function(namespace_builder &, name, function_prototype, Fn Ctor);

// forward declare a function
consteval function_decl append_function(namespace_builder &, name, function_prototype);

template <class Fn> 
consteval void define(namespace_builder &, function_decl, Fn Ctor);

template <class Fn> 
consteval function_template_decl append_function_template(namespace_builder &, template_prototype, name, function_prototype, Fn Ctor);

consteval function_template_decl append_function_template(namespace_builder &, template_prototype, name, function_prototype);
consteval template_parameter_decl append_type_parameter(template_prototype &, identifier);
consteval template_parameter_decl append_value_parameter(template_prototype &, identifier, type);

template <class Fn> 
consteval namespace_decl append_namespace(namespace_builder &, identifier, Fn Ctor);

consteval alias_type_decl append_alias(namespace_builder &, identifier, type);

template <class Fn> 
consteval class_decl append_class(namespace_builder &, identifier, base_classes, Fn Ctor);

template <class Fn> 
consteval class_template_decl append_class_template(namespace_builder &, template_prototype, identifier, base_classes, Fn Ctor);

template <class Fn> 
consteval class_template_decl append_class_template(class_builder &, template_prototype, identifier, base_classes, Fn Ctor);

template <class Fn> 
consteval class_template_spec_decl append_specialization(namespace_builder &, template_prototype, class_template_decl, template_arguments, base_classes, Fn Ctor);

consteval class_decl append_class(namespace_builder &, identifier);
consteval class_decl append_struct(namespace_builder &, identifier);
consteval var_decl append_var(class_builder &, identifier, type, expr);
consteval var_decl append_var(class_builder &, identifier, type, var_decl_spec);
consteval void set_static(var_decl_spec &);
consteval void set_constexpr(var_decl_spec &);
consteval var_decl append_var(namespace_builder &, identifier, type, expr);
consteval var_decl append_var(namespace_builder &, identifier, type, var_decl_spec);
consteval parameter_var_decl append_parameter(function_prototype &, identifier, type);
consteval void return_type(function_prototype &, type);
consteval void set_constexpr(function_prototype &);
consteval void set_consteval(function_prototype &);
consteval void set_noexcept(function_prototype &);
consteval void set_c_linkage(function_prototype &);
consteval field_decl append_field(class_builder &, identifier, type);
consteval field_decl append_field(class_builder &, identifier, type, expr);
consteval alias_type_decl append_alias(class_builder &, identifier, type);

// invoke Fn with a `class_methods_builder` once the definition of the class is complete. 
// useful to define constructors or multiple member functions at once
template <class Fn> 
consteval void on_completion(class_builder &, Fn);

consteval function_decl append_function(class_builder &, name, function_prototype);

template <class Fn> 
consteval function_decl append_function(class_builder &, name, function_prototype, Fn Ctor);

// set the access specifier for the next declarations to be created
consteval void set_access(class_builder &, access);

consteval void object_type(method_prototype &, type);

consteval method_decl append_method(class_builder &, name, method_prototype);

template <class Fn> 
consteval method_decl append_method(class_builder &, name, method_prototype, Fn Ctor);

consteval constructor_decl append_constructor(class_builder &, function_prototype);

template <class Fn> 
consteval void define(class_methods_builder &, constructor_decl, constructor_initializers, Fn Ctor);

template <class Fn> 
consteval void define(namespace_builder &, method_decl, Fn Ctor);

template <class Fn> 
consteval void define(class_methods_builder &, method_decl, Fn Ctor);

template <class Fn> 
consteval enum_decl append_enum(namespace_builder &, identifier, Fn Ctor);
consteval enum_decl append_constant(enum_builder &, identifier);
consteval enum_constant_decl append_constant(enum_builder &, identifier, expr);

// Builder properties
consteval namespace_decl decl_of(const namespace_builder &);
consteval method_decl decl_of(const method_builder &);
consteval function_decl decl_of(const function_builder &);
consteval class_decl decl_of(const class_builder &);
consteval class_decl decl_of(const class_methods_builder &);
consteval source_location location(const function_builder &);

Expressions construction

consteval decl_ref_expr make_decl_ref_expr(var_decl);
consteval decl_ref_expr make_decl_ref_expr(enum_constant_decl);
consteval decl_ref_expr make_decl_ref_expr(function_decl);
consteval field_expr make_field_expr(expr, field_decl);
consteval field_expr make_field_expr(expr, identifier);
consteval operator_expr make_deref_expr(expr);
consteval operator_expr make_operator_expr(operator_kind, expr, expr);
consteval operator_expr make_operator_expr(operator_kind, expr);
consteval operator_expr make_assign_expr(expr, expr);
consteval call_expr make_call_expr(expr, expr_list);
consteval call_expr make_call_expr(function_decl, expr_list);
consteval call_expr make_call_expr(overload_set, expr_list);
consteval call_expr make_call_expr(overload_set, template_arguments, expr_list);
consteval call_expr make_call_expr(function_template_decl, template_arguments, expr_list);

// make a member call expression from a given identifier 
consteval call_expr make_call_expr(expr Callee, identifier, expr_list);
consteval call_expr make_call_expr(expr Callee, identifier, template_arguments, expr_list);
consteval cast_expr make_static_cast_expr(type, expr);
consteval cast_expr make_dynamic_cast_expr(type, expr);
consteval cast_expr make_reinterpret_cast_expr(type, expr);
consteval new_expr make_new_expr(type, expr_list);
consteval new_expr make_new_expr(expr_list, type, expr_list);
consteval new_expr make_array_new_expr(type, expr, expr_list);
consteval new_expr make_array_new_expr(expr_list, type, expr, expr_list);
consteval delete_expr make_delete_expr(expr);
consteval delete_expr make_array_delete_expr(expr);
consteval construct_expr make_construct_expr(type, expr_list);
consteval construct_aggregate_expr make_construct_expr(type, const constructor_initializers &);
consteval overload_expr make_overload_expr(overload_set);
consteval literal_expr make_literal_expr(long long);
consteval literal_expr make_literal_expr(const char *);
consteval literal_expr make_literal_expr(identifier);
consteval literal_expr make_literal_expr(ostream);
template <class T> 
consteval literal_expr make_literal_expr(T value);

consteval this_expr make_this_expr(method_builder &);
consteval field_expr make_field_expr(method_builder &, field_decl);

Diagnostics and text

consteval void error(source_location, const char *);
consteval void error(const char *);
consteval void warning(source_location, const char *);
consteval void warning(const char *);
consteval void note(source_location, const char *);
consteval void note(const char *);
consteval void error(source_location, ostream);
consteval void error(ostream);
consteval void warning(source_location, ostream);
consteval void warning(ostream);
consteval void note(source_location, ostream);
consteval void note(ostream);
consteval void print(const ostream &);
consteval void print(const char *);
consteval void ensure(bool);

consteval ostream &operator<<(ostream &, unsigned int);
consteval ostream &operator<<(ostream &, unsigned long);
consteval ostream &operator<<(ostream &, long);
consteval ostream &operator<<(ostream &, int);
consteval ostream &operator<<(ostream &, char);
consteval ostream &operator<<(ostream &, bool);
consteval ostream &operator<<(ostream &, double);
consteval ostream &operator<<(ostream &, const char *);
consteval ostream &operator<<(ostream &, expr);
consteval ostream &operator<<(ostream &, type);
consteval ostream &operator<<(ostream &, stmt);
consteval ostream &operator<<(ostream &, name);
consteval ostream &operator<<(ostream &, expr_list);
consteval ostream &operator<<(ostream &, type_list);
consteval ostream &operator<<(ostream &, template_argument);
consteval ostream &operator<<(ostream &, const ostream &);
consteval ostream &operator<<(ostream &, source_location);
// Write the definition of the declaration to the stream
consteval ostream &operator<<(ostream &, decl_as_written);
consteval ostream_iterator begin(const ostream &);
consteval ostream_iterator end(const ostream &);
consteval unsigned long size(const ostream &);
consteval void clear(ostream &);

consteval decl_as_written as_written(decl);

Misc

consteval unsigned long line(source_location);
consteval unsigned long column(source_location);
consteval ostream file_name(source_location);
consteval ostream file_path(source_location);

consteval void push_back(expr_list &, expr);
consteval void push_back(type_list &, type);
consteval void push_back(template_arguments &, template_argument);
consteval void push_back(overload_set &, function_decl);
consteval void push_back(decl_list &, decl);