inheritance
cpp.Inheritance.pathWithin
Section titled “cpp.Inheritance.pathWithin”def Inheritance.pathWithin (fuel : Nat) (known : List ClassMembers) (x : String) (y : String) : Option (List Nat)The positions of the base subobjects from a class to one of its bases (empty for the class itself), if it is one; fuel bounds the depth.
cpp.Inheritance.denied
Section titled “cpp.Inheritance.denied”def Inheritance.denied (g : Globals Cpp.constructs) (x : String) (y : String) : Option StringWhy a class cannot be converted to a base of it here ([conv.ptr]p3, [class.access.base]p4), in clang’s words: the base is more than one subobject of it (paths through one virtual base are one), or it is reached through a base inherited privately or protectedly that the function being checked may not use. None when it can, or is no base.
cpp.Inheritance.publicUnambiguous
Section titled “cpp.Inheritance.publicUnambiguous”def Inheritance.publicUnambiguous (all : List ClassMembers) (x : String) (y : String) : BoolWhether a base of a class is one subobject of it reached through public bases only (a handler for the base catches an exception of the class only then, [except.handle]p3; where the handler is does not matter).
cpp.Inheritance.deniedFor
Section titled “cpp.Inheritance.deniedFor”def Inheritance.deniedFor (g : Globals Cpp.constructs) (t : Ty Cpp.constructs) (e : TypedExpr Cpp.constructs) : Option StringWhy a value cannot be converted to a type that is a base of its class (or a pointer to one, from a pointer) here.
cpp.Inheritance.path
Section titled “cpp.Inheritance.path”def Inheritance.path (known : List ClassMembers) (x : String) (y : String) : Option (List Nat)The path from a class to a base, if it is one.
cpp.Inheritance.subobject
Section titled “cpp.Inheritance.subobject”def Inheritance.subobject (types : TypeExtension Cpp.constructs) (g : Globals Cpp.constructs) (n : NodeId) (object : TypedExpr Cpp.constructs) (path : List Nat) : Option (TypedExpr Cpp.constructs)The base subobject of an object (an lvalue) along a path: each step the member named for the base’s position
(#baseK) of the type the completed struct gives it, or for a virtual base what its pointer #vbp:V points to.
cpp.Inheritance.asBase
Section titled “cpp.Inheritance.asBase”def Inheritance.asBase (types : TypeExtension Cpp.constructs) (g : Globals Cpp.constructs) (n : NodeId) (y : String) (object : TypedExpr Cpp.constructs) : Option (TypedExpr Cpp.constructs)An object (an lvalue) as its base of a class, if the class is a base of the object’s (none when the object is of that class itself, or the class is no base of it).
cpp.Inheritance.pointer
Section titled “cpp.Inheritance.pointer”def Inheritance.pointer (types : TypeExtension Cpp.constructs) (g : Globals Cpp.constructs) (n : NodeId) (t : Ty Cpp.constructs) (e : TypedExpr Cpp.constructs) : Option (TypedExpr Cpp.constructs)A pointer to a derived class converted to a pointer to a base ([conv.ptr]p3): the address of the base subobject.
cpp.Inheritance.value
Section titled “cpp.Inheritance.value”def Inheritance.value (types : TypeExtension Cpp.constructs) (g : Globals Cpp.constructs) (n : NodeId) (t : Ty Cpp.constructs) (e : TypedExpr Cpp.constructs) : Option (TypedExpr Cpp.constructs)An object of a derived class used as a value of a base class: the base subobject (copied, the rest sliced off).
cpp.Inheritance.cast
Section titled “cpp.Inheritance.cast”def Inheritance.cast (types : TypeExtension Cpp.constructs) (checker : Checker Cpp.constructs) (g : Globals Cpp.constructs) (env : Env Cpp.constructs) (e : Expr) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))A pointer to a base class subobject cast to a pointer to a derived class (static_cast<D*>(p) or (D*)p,
[expr.static.cast]p11): the object containing it, as many levels up as the path from the derived class to the base;
a pointer cast to a pointer to a base, the conversion. None unless the cast is between a class and its base.
cpp.Inheritance.containingCall
Section titled “cpp.Inheritance.containingCall”def Inheritance.containingCall (types : TypeExtension Cpp.constructs) (checker : Checker Cpp.constructs) (g : Globals Cpp.constructs) (env : Env Cpp.constructs) (n : NodeId) (x : String) (a : Expr) (k : Nat) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))The internal call #containing:X(p, k) a dispatcher makes (Classes.containingCall): the pointer to the
complete object of class X containing what p points to, k levels up.
cpp.Address.containing
Section titled “cpp.Address.containing”def Address.containing (steps : Nat) (a : Address) : Option AddressThe object containing the one an address is at, steps levels up (the path’s last steps dropped).
cpp.Inheritance.containing
Section titled “cpp.Inheritance.containing”def Inheritance.containing (evaluator : Evaluator Cpp.constructs) (s : State Cpp.constructs) (n : NodeId) (steps : Nat) (operands : List (TypedExpr Cpp.constructs)) : Evaluated Cpp.constructs ValueThe pointer to the object containing the one a pointer points to, steps levels up (a null pointer stays null).