aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-06-03 00:08:17 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-15 09:42:45 -0400
commitbdeeeaf71f1f4a9911d85c5aa5ad0500086201dc (patch)
treed0df29e3569e1dce2e8ca7acb77dca2e44aee9be
parent3a9222bcb363bff255dc78d2a4aef0ac08da6274 (diff)
downloadgcc-bdeeeaf71f1f4a9911d85c5aa5ad0500086201dc.zip
gcc-bdeeeaf71f1f4a9911d85c5aa5ad0500086201dc.tar.gz
gcc-bdeeeaf71f1f4a9911d85c5aa5ad0500086201dc.tar.bz2
[Ada] Fix oversight in Delayed_Aspect_Present predicate
gcc/ada/ * sem_ch3.adb (Delayed_Aspect_Present): Fix oversight in loop. * freeze.adb (Freeze_Object_Declaration): Use Declaration_Node instead of Parent for the sake of consistency.
-rw-r--r--gcc/ada/freeze.adb4
-rw-r--r--gcc/ada/sem_ch3.adb6
2 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index b24e917..74d15b5 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -3439,11 +3439,11 @@ package body Freeze is
if Has_Delayed_Aspects (E)
and then Expander_Active
and then Is_Array_Type (Typ)
- and then Present (Expression (Parent (E)))
+ and then Present (Expression (Declaration_Node (E)))
and then No (Linker_Section_Pragma (E))
then
declare
- Decl : constant Node_Id := Parent (E);
+ Decl : constant Node_Id := Declaration_Node (E);
Lhs : constant Node_Id := New_Occurrence_Of (E, Loc);
begin
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index a184a87..435c69f 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -3891,9 +3891,11 @@ package body Sem_Ch3 is
begin
if Present (Aspect_Specifications (N)) then
- A := First (Aspect_Specifications (N));
- A_Id := Get_Aspect_Id (Chars (Identifier (A)));
+ A := First (Aspect_Specifications (N));
+
while Present (A) loop
+ A_Id := Get_Aspect_Id (Chars (Identifier (A)));
+
if A_Id = Aspect_Alignment or else A_Id = Aspect_Address then
-- Set flag on object entity, for later processing at