]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix wrong assignment of aggregate to full-access component
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 29 Mar 2021 22:41:46 +0000 (00:41 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 29 Mar 2021 22:45:38 +0000 (00:45 +0200)
This is a regression present on the mainline: the compiler (front-end) fails
to assign an aggregate to a full-access component (i.e. Atomic or VFA) as a
whole if the type of the component is not full access itself.

gcc/ada/
PR ada/99802
* freeze.adb (Is_Full_Access_Aggregate): Call Is_Full_Access_Object
on the name of an N_Assignment_Statement to spot full access.

gcc/ada/freeze.adb

index 8dc8a2223960dc3020c4f0d4ad6771a2c935bbd8..da14af9b8bd0b49ba07d79cd04490bbf38d9c5b8 100644 (file)
@@ -1754,8 +1754,7 @@ package body Freeze is
             Typ := Etype (Name (Par));
 
             if not Is_Full_Access (Typ)
-              and then not (Is_Entity_Name (Name (Par))
-                             and then Is_Full_Access (Entity (Name (Par))))
+              and then not Is_Full_Access_Object (Name (Par))
             then
                return False;
             end if;