diff options
| author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-20 09:23:26 +0000 |
|---|---|---|
| committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-20 09:23:26 +0000 |
| commit | 0a13aca8a92a07b7c5c1dbcbdbcce6f04c9e07d5 (patch) | |
| tree | a23455fc57b6be09a4f5b366cd921e5eb0f639a5 | |
| parent | 748e5d456ca0b4b412d0a0672b9bc745f33139dc (diff) | |
| download | ppe42-gcc-0a13aca8a92a07b7c5c1dbcbdbcce6f04c9e07d5.tar.gz ppe42-gcc-0a13aca8a92a07b7c5c1dbcbdbcce6f04c9e07d5.zip | |
2012-03-20 Yannick Moy <moy@adacore.com>
* gnat_rm.texi, sem_attr.ads: Update documentation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185562 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/ada/gnat_rm.texi | 20 | ||||
| -rw-r--r-- | gcc/ada/sem_attr.ads | 7 |
3 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5a6aa8c5d1d..4e5280b8137 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2012-03-20 Yannick Moy <moy@adacore.com> + + * gnat_rm.texi, sem_attr.ads: Update documentation. + 2012-03-19 Yannick Moy <moy@adacore.com> * sem_ch6.adb: Minor code clean up. diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index e0ab56f4c2c..96e3ab150f2 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -285,6 +285,7 @@ Implementation Defined Attributes * Unconstrained_Array:: * Universal_Literal_String:: * Unrestricted_Access:: +* Valid_Scalars:: * VADS_Size:: * Value_Size:: * Wchar_T_Size:: @@ -6035,6 +6036,7 @@ consideration, you should minimize the use of these attributes. * Unconstrained_Array:: * Universal_Literal_String:: * Unrestricted_Access:: +* Valid_Scalars:: * VADS_Size:: * Value_Size:: * Wchar_T_Size:: @@ -6991,6 +6993,24 @@ scope. For instance, a function cannot use @code{Unrestricted_Access} to create a unconstrained pointer and then return that value to the caller. +@node Valid_Scalars +@unnumberedsec Valid_Scalars +@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. + @node VADS_Size @unnumberedsec VADS_Size @cindex @code{Size}, VADS compatibility diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads index 25e6adf3519..71ac668c757 100644 --- a/gcc/ada/sem_attr.ads +++ b/gcc/ada/sem_attr.ads @@ -554,7 +554,12 @@ package Sem_Attr is ------------------- Attribute_Valid_Scalars => True, - -- Typ'Valid_Scalars applies to ??? + -- Obj'Valid_Scalars applies to objects of scalar types, on which it is + -- equivalent to Obj'Valid, and objects of array and record types, on + -- which it amounts to applying 'Valid to each subcomponent of Obj. It + -- does not apply to prefixes of classwide type, or of a formal generic + -- type that has an unknown discriminant (which could be instantiated + -- with a classwide type). ---------------- -- Value_Size -- |

