https://gcc.gnu.org/g:cca7647392727038c86a9eb785cbd673896afa57

commit r15-6524-gcca7647392727038c86a9eb785cbd673896afa57
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Wed Dec 4 13:45:24 2024 +0100

    ada: Leave empty parent in an array component of an anonymous access type
    
    An itype created for a record component with an anonymous access type has 
empty
    parent. However, a similar itype created for an array component has its 
parent
    copied from the parent of the array type.
    
    The above discrepancy appears to be not needed for the frontend. Also, it is
    confusing for the GNATprove backend, because it looks like the itype entity
    of the array component comes from a declaration of the array itself.
    
    gcc/ada/ChangeLog:
    
            * sem_ch3.adb (Array_Type_Declaration): Don't copy parent for an 
itype
            created by an array component declaration.

Diff:
---
 gcc/ada/sem_ch3.adb | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index eb53d59032c6..7bedc043c8d4 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -6612,12 +6612,6 @@ package body Sem_Ch3 is
                             N           => Access_Definition (Component_Def));
          Set_Is_Local_Anonymous_Access (Element_Type);
 
-         --  Propagate the parent. This field is needed if we have to generate
-         --  the master_id associated with an anonymous access to task type
-         --  component (see Expand_N_Full_Type_Declaration.Build_Master)
-
-         Copy_Parent (To => Element_Type, From => T);
-
          --  Ada 2005 (AI-230): In case of components that are anonymous access
          --  types the level of accessibility depends on the enclosing type
          --  declaration

Reply via email to