aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index c9f78fa..3351cde 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1163,6 +1163,15 @@ package body Sem_Ch13 is
when Aspect_Invariant |
Aspect_Type_Invariant =>
+ -- Check placement legality
+
+ if not Nkind_In (N, N_Private_Type_Declaration,
+ N_Private_Extension_Declaration)
+ then
+ Error_Msg_N
+ ("invariant aspect must apply to a private type", N);
+ end if;
+
-- Construct the pragma
Aitem :=