diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-06 11:34:30 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-06 11:34:30 +0200 |
commit | dd89dddff4f63572408c3bcd602eb8773288179c (patch) | |
tree | 081c331a23be4c245d4cc36c7f97c0f64be94ee7 /gcc/ada/sem_ch3.adb | |
parent | 3e720c9601e26585c386c983084fdc2926902936 (diff) | |
download | gcc-dd89dddff4f63572408c3bcd602eb8773288179c.zip gcc-dd89dddff4f63572408c3bcd602eb8773288179c.tar.gz gcc-dd89dddff4f63572408c3bcd602eb8773288179c.tar.bz2 |
[multiple changes]
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
properly incomplete subtypes that may be created by explicit or
implicit declarations.
(Is_Base_Type): Take E_Incomplete_Subtype into account.
(Subtype_Kind): Ditto.
* sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
Ekind of a subtype of a discriminated incomplete type.
(Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
incomplete types, to preserve error reporting.
(Process_Incomplete_Dependents): Do not create a subtype
declaration for an incomplete subtype that is created internally.
* sem_ch7.adb (Analyze_Package_Specification): Handle properly
incomplete subtypes that do not require a completion, either
because they are limited views, of they are generic actuals.
2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb (Insert_Valid_Check): Remove the
suspicious manipulation of the Do_Range_Check flag as ths is
no linger needed. Suppress validity check when analysing the
validation variable.
2017-09-06 Philippe Gil <gil@adacore.com>
* g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
GNATCOLL.Memory
2017-09-06 Bob Duff <duff@adacore.com>
* sem_elim.adb: Minor comment fix.
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Is_Object_Reference): A function call is an
object reference, and thus attribute references for attributes
that are functions (such as Pred and Succ) as well as predefined
operators are legal in contexts that require an object, such as
the prefix of attribute Img and the Ada2020 version of 'Image.
From-SVN: r251759
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index fcbf86e..6fbcea27 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -10094,7 +10094,11 @@ package body Sem_Ch3 is -- elaboration, because only the access type is needed in the -- initialization procedure. - Set_Ekind (Def_Id, Ekind (T)); + if Ekind (T) = E_Incomplete_Type then + Set_Ekind (Def_Id, E_Incomplete_Subtype); + else + Set_Ekind (Def_Id, Ekind (T)); + end if; if For_Access and then Within_Init_Proc then null; @@ -13629,15 +13633,9 @@ package body Sem_Ch3 is procedure Fixup_Bad_Constraint is begin - -- Set a reasonable Ekind for the entity. For an incomplete type, - -- we can't do much, but for other types, we can set the proper - -- corresponding subtype kind. + -- Set a reasonable Ekind for the entity, including incomplete types. - if Ekind (T) = E_Incomplete_Type then - Set_Ekind (Def_Id, Ekind (T)); - else - Set_Ekind (Def_Id, Subtype_Kind (Ekind (T))); - end if; + Set_Ekind (Def_Id, Subtype_Kind (Ekind (T))); -- Set Etype to the known type, to reduce chances of cascaded errors @@ -20802,7 +20800,9 @@ package body Sem_Ch3 is -- Ada 2005 (AI-412): Transform a regular incomplete subtype into a -- corresponding subtype of the full view. - elsif Ekind (Priv_Dep) = E_Incomplete_Subtype then + elsif Ekind (Priv_Dep) = E_Incomplete_Subtype + and then Comes_From_Source (Priv_Dep) + then Set_Subtype_Indication (Parent (Priv_Dep), New_Occurrence_Of (Full_T, Sloc (Priv_Dep))); Set_Etype (Priv_Dep, Full_T); |