diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-04-27 11:30:06 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-19 04:17:10 -0400 |
commit | d57f8e40433cb73fa08fab92b3238a1981c7c037 (patch) | |
tree | 137254873f4a612d695a912bc88a19434b13f39e /gcc | |
parent | a4dafb8b92e00e2f783bf8915b17f1f450eff227 (diff) | |
download | gcc-d57f8e40433cb73fa08fab92b3238a1981c7c037.zip gcc-d57f8e40433cb73fa08fab92b3238a1981c7c037.tar.gz gcc-d57f8e40433cb73fa08fab92b3238a1981c7c037.tar.bz2 |
[Ada] Add comments about attribute 'Valid_Scalars on private tagged types
2020-06-19 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* exp_attr.adb (Expand_N_Attribute_Reference): Add comment.
* sem_attr.adb (Analyze_Attribute): Add ??? comment.
* sem_util.ads (Valid_Scalars): This routine is only used for
'Valid_Scalars and not for 'Valid.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_attr.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sem_attr.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_util.ads | 8 |
3 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 0eead44..84a36f8 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -7094,7 +7094,8 @@ package body Exp_Attr is Expr := Empty; - -- Attribute 'Valid_Scalars is not supported on private tagged types + -- Attribute 'Valid_Scalars is not supported on private tagged types; + -- see a detailed explanation where this attribute is analyzed. if Is_Private_Type (Ptyp) and then Is_Tagged_Type (Ptyp) then null; diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index bf45fb8..3bd87fd 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -7016,6 +7016,10 @@ package body Sem_Attr is -- types due to a code generation issue. Is_Visible_Component -- does not allow for a component of a private tagged type to -- be successfully retrieved. + -- ??? This attribute should simply ignore type privacy + -- (see Validated_View). It should examine components of the + -- tagged type extensions (if any) and recursively examine + -- 'Valid_Scalars of the parent's type (if any). -- Do not use Error_Attr_P because this bypasses any subsequent -- processing and leaves the attribute with type Any_Type. This diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 7a54b5c..d99edea 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3050,10 +3050,10 @@ package Sem_Util is -- conversions, and unchecked conversions. function Validated_View (Typ : Entity_Id) return Entity_Id; - -- Obtain the "validated view" of arbitrary type Typ which is suitable - -- for verification by attributes 'Valid and 'Valid_Scalars. This view - -- is the type itself or its full view while stripping away concurrency, - -- derivations, and privacy. + -- Obtain the "validated view" of arbitrary type Typ which is suitable for + -- verification by attributes 'Valid_Scalars. This view is the type itself + -- or its full view while stripping away concurrency, derivations, and + -- privacy. function Visible_Ancestors (Typ : Entity_Id) return Elist_Id; -- [Ada 2012:AI-0125-1]: Collect all the visible parents and progenitors |