diff options
Diffstat (limited to 'gcc/ada/gnat_rm.texi')
-rw-r--r-- | gcc/ada/gnat_rm.texi | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 96e3ab150f2..88a30f9fe5d 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -6998,18 +6998,22 @@ caller. @findex Valid_Scalars @noindent The @code{'Valid_Scalars} attribute is intended to make it easier to -check the validity of scalar subcomponents of composite objects. It -is defined for any prefix @code{X} that denotes a scalar or composite -object (after any implicit dereference), that is not of classwide type -or of a formal generic type with an unknown discriminant. -@code{X'Valid_Scalars} yields True if and only if @code{X'Valid} -yields True, if @code{X} is a scalar object, or @code{Y'Valid} yields -True for every scalar subcomponent @code{Y} of @code{X}, if @code{X} -is a composite object. If computing the value of -@code{X'Valid_Scalars} involves evaluations of subtype predicates, it -is unspecified in which order these evaluations take place, or if they -take place at all in case the result is False. The value of this -attribute is of the predefined type Boolean. +check the validity of scalar subcomponents of composite objects. It +is defined for any prefix @code{X} that denotes an object. +The value of this attribute is of the predefined type Boolean. +@code{X'Valid_Scalars} yields True if and only if evaluation of +@code{P'Valid} yields True for every scalar part P of X or if X has +no scalar parts. It is not specified in what order the scalar parts +are checked, nor whether any more are checked after any one of them +is determined to be invalid. If the prefix @code{X} is of a class-wide +type @code{T'Class} (where @code{T} is the associated specific type), +or if the prefix @code{X} is of a specific tagged type @code{T}, then +only the scalar parts of components of @code{T} are traversed; in other +words, components of extensions of @code{T} are not traversed even if +@code{T'Class (X)'Tag /= T'Tag} . The compiler will issue a warning if it can +be determined at compile time that the prefix of the attribute has no +scalar parts (e.g., if the prefix is of an access type, an interface type, +an undiscriminated task type, or an undiscriminated protected type). @node VADS_Size @unnumberedsec VADS_Size |