diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-11 10:10:52 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-06-02 09:06:38 +0000 |
commit | dc94991cb702e6432de9fea3a2980c5076d49a63 (patch) | |
tree | 0855daefcc11c50c6997aef32d2af7db8ff9f01d /gcc | |
parent | d1ae37393be7f3fae1cbae075c8302f8d1847965 (diff) | |
download | gcc-dc94991cb702e6432de9fea3a2980c5076d49a63.zip gcc-dc94991cb702e6432de9fea3a2980c5076d49a63.tar.gz gcc-dc94991cb702e6432de9fea3a2980c5076d49a63.tar.bz2 |
[Ada] Propagate Has_Inherit{able,ed}_Invariants to base types
The two flags apply to base types only like Has_Own_Invariants.
gcc/ada/
* sem_util.adb (Propagate_DIC_Attributes): Add ??? comment.
(Propagate_Invariant_Attributes): Likewise. Propagate the
Has_Inheritable_Invariants and Has_Inherited_Invariants to
the base type of the target type.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_util.adb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index c231fbb..265c11a 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -27312,7 +27312,7 @@ package body Sem_Util is -- The setting of the attributes is intentionally conservative. This -- prevents accidental clobbering of enabled attributes. We need to -- call Base_Type twice, because it is sometimes not set to an actual - -- base type. + -- base type??? if Has_Inherited_DIC (From_Typ) then Set_Has_Inherited_DIC (Base_Type (Base_Type (Typ))); @@ -27362,14 +27362,14 @@ package body Sem_Util is -- The setting of the attributes is intentionally conservative. This -- prevents accidental clobbering of enabled attributes. We need to -- call Base_Type twice, because it is sometimes not set to an actual - -- base type. + -- base type??? if Has_Inheritable_Invariants (From_Typ) then - Set_Has_Inheritable_Invariants (Typ); + Set_Has_Inheritable_Invariants (Base_Type (Base_Type (Typ))); end if; if Has_Inherited_Invariants (From_Typ) then - Set_Has_Inherited_Invariants (Typ); + Set_Has_Inherited_Invariants (Base_Type (Base_Type (Typ))); end if; if Has_Own_Invariants (From_Typ) then |