diff options
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_aggr.adb | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c10f7ff..ff66682 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2019-09-19 Eric Botcazou <ebotcazou@adacore.com> + * exp_aggr.adb (Has_Mutable_Components): Look at the underlying + type of components to find out whether they are mutable. + +2019-09-19 Eric Botcazou <ebotcazou@adacore.com> + * sem_ch12.adb (Instantiate_Package_Body): Check that the body has not already been instantiated when the body of the parent was being loaded. diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 63f9d1a..3d3dd1b 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -8162,13 +8162,15 @@ package body Exp_Aggr is function Has_Mutable_Components (Typ : Entity_Id) return Boolean is Comp : Entity_Id; + Ctyp : Entity_Id; begin Comp := First_Component (Typ); while Present (Comp) loop - if Is_Record_Type (Etype (Comp)) - and then Has_Discriminants (Etype (Comp)) - and then not Is_Constrained (Etype (Comp)) + Ctyp := Underlying_Type (Etype (Comp)); + if Is_Record_Type (Ctyp) + and then Has_Discriminants (Ctyp) + and then not Is_Constrained (Ctyp) then return True; end if; |