diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-12-12 10:02:00 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-12 10:02:00 +0000 |
commit | 605d816615bf239b9ca6627b18b861b0ff12eac0 (patch) | |
tree | 32b09539240211db1c79af5ed916215b6101e26a /gcc/ada/sem_ch4.adb | |
parent | 87b66149a315e0e0bc80a1075ce6da615fe55199 (diff) | |
download | gcc-605d816615bf239b9ca6627b18b861b0ff12eac0.zip gcc-605d816615bf239b9ca6627b18b861b0ff12eac0.tar.gz gcc-605d816615bf239b9ca6627b18b861b0ff12eac0.tar.bz2 |
[Ada] Constraint is ignored on constrained access record component
2019-12-12 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch3.adb (Constrain_Access): Remove obsolete comments and
warning concerning component types of an access type whose
designated type is a constrained record type. (Such constraints
were previously ignored). Set scope of itype for component to
the scope of the enclosing record.
* sem_ch4.adb: Remove call to Set_Ekind.
* sem_util.adb (Build_Actual_Subtype_Of_Component): Handle
components whose type is an access to a constrained
discriminant, where the constraints may be given by the
discriminants of the enclosing type. New subprogram
Build_Access_Record_Constraint.
gcc/testsuite/
* gnat.dg/warn24.adb: Remove expected warning.
From-SVN: r279281
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r-- | gcc/ada/sem_ch4.adb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 313398a..0890539 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -4812,16 +4812,15 @@ package body Sem_Ch4 is Set_Etype (N, Etype (Comp)); else - -- Component type depends on discriminants. Enter the - -- main attributes of the subtype. + -- If discriminants were present in the component + -- declaration, they have been replaced by the + -- actual values in the prefix object. declare Subt : constant Entity_Id := Defining_Identifier (Act_Decl); - begin Set_Etype (Subt, Base_Type (Etype (Comp))); - Set_Ekind (Subt, Ekind (Etype (Comp))); Set_Etype (N, Subt); end; end if; |