aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-04-19 05:44:10 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-17 04:14:23 -0400
commit86f80604361ef12ecbe2d749fcb5f08ec7f71bfc (patch)
treeaa2fe2589350f32fd74ec4ebcd7c13086721c501 /gcc/ada
parenta5c11aa2d569cdeffa74ad3e9db9abee8db384e5 (diff)
downloadgcc-86f80604361ef12ecbe2d749fcb5f08ec7f71bfc.zip
gcc-86f80604361ef12ecbe2d749fcb5f08ec7f71bfc.tar.gz
gcc-86f80604361ef12ecbe2d749fcb5f08ec7f71bfc.tar.bz2
[Ada] ACATS 4.1H - BA12018 - Missed errors for private with
2020-06-17 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch10.adb (Expand_With_Clause): Add missing handling of N_Generic_Subprogram_Declaration, N_Subprogram_Declaration, N_Subprogram_Body.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch10.adb12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 28f4674..f439382 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -3197,12 +3197,16 @@ package body Sem_Ch10 is
Set_Library_Unit (Withn, Parent (Unit_Declaration_Node (Ent)));
Set_Parent_With (Withn);
- -- If the unit is a package or generic package declaration, a private_
- -- with_clause on a child unit implies that the implicit with on the
- -- parent is also private.
+ -- If the unit is a [generic] package or subprogram declaration
+ -- (including a subprogram body acting as spec), a private_with_clause
+ -- on a child unit implies that the implicit with on the parent is also
+ -- private.
if Nkind_In (Unit (N), N_Generic_Package_Declaration,
- N_Package_Declaration)
+ N_Package_Declaration,
+ N_Generic_Subprogram_Declaration,
+ N_Subprogram_Declaration,
+ N_Subprogram_Body)
then
Set_Private_Present (Withn, Private_Present (Item));
end if;