Skip to content

staticmembers

def StaticMembers.first {A : Type} (found : List (Option A)) : Option A

The first of the values found.

def StaticMembers.anyNamed (cs : List ClassMembers) (name : String) : Bool

Whether some class has a static member by a name (before checking an object for one).

def StaticMembers.named (fuel : Nat) (cs : List ClassMembers) (x : String) (name : String) : Option (String * StaticMember)

The static member a class has by a name, its own or a base’s (the class it belongs to with it).

def StaticMembers.lowered (cs : List ClassMembers) (lowered : String) : Option (String * StaticMember)

The static member a declaration or a function is lowered from, with its class.

def StaticMembers.checked (g : Globals Cpp.constructs) (n : NodeId) (lowered : String) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A use of a static member rejected when the function being checked may not use it.

def StaticMembers.through (checker : Checker Cpp.constructs) (asLvalue : Bool) (g : Globals Cpp.constructs) (env : Env Cpp.constructs) (n : NodeId) (o : Expr) (arrow : Bool) (name : String) (use : String -> Expr) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A static member through an object, as the object evaluated and then the member (use makes it from what the member is lowered to), as an lvalue or not; none when the object’s class has no static member by the name.

def StaticMembers.unmodeled (n : NodeId) (name : String) (owner : String) (member : String) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A name written through a standard class (owner), at n, that the class as modeled does not declare: the model has the members programs have needed, not all of the standard’s, so this is not the program’s error. A constant of the headers’ table (std::string::npos) goes on to the core, which has it; any other is not provided. member is the name as written after the class.

def StaticMembers.missing (g : Globals Cpp.constructs) (n : NodeId) (name : String) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A name written through a class the program has that nothing declares (C::m, ns::D::m, which a front end that leaves names to Cella sends as it is written), at n: the class has no member by that name ([expr.prim.id.qual]p2, the name is looked up in the class), rejected as clang says it; none when the part before the last :: is not such a class, or the class has a member by that name (used where it may not be: the checker’s other words). The classes are g’s.

def StaticMembers.expression (checker : Checker Cpp.constructs) (asLvalue : Bool) (g : Globals Cpp.constructs) (env : Env Cpp.constructs) (e : Expr) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A use of a static member (as an lvalue or not): its access checked by name, its object evaluated through an object; a name written through a class that has no member by it rejected (StaticMembers.missing).

def StaticMembers.call (g : Globals Cpp.constructs) (n : NodeId) (f : String) : Option (CheckResult Cpp.constructs (Lifted Cpp.constructs))

A call of a static member function by name, its access checked (a call statement is not an expression).