checkedc
checkedc copied to clipboard
Update spec to include missing cases for bounds-safe interface assignment compatibility
The current rules for assignment compatibility of expressions involving bounds-safe interfaces are missing two cases.
The first case is related to assignments involving nested pointers.
An assignment *p = e
can pass type checking if:
-
p
has an unchecked pointer type and a bounds-safe interface, and -
e
has a checked pointer type, and - the referent type of
e
is assignment compatible with the referent type of the referent type ofp
The second case is related to assignments of an unchecked pointer with an _Nt_array_ptr
bounds-safe interface to an _Nt_array_ptr
variable.
An assignment v = e
can pass type checking if:
-
v
has type_Nt_array_ptr<T>
, and -
e
has unchecked pointer type and a bounds-safe interface of_Nt_array_ptr<U>
, and - the referent types
T
andU
are assignment compatible.