diff options
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index f8ca61ea52e..09e9717f18b 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -2332,8 +2332,15 @@ package body Sem_Ch12 is return; elsif Ekind (Gen_Unit) /= E_Generic_Package then - Error_Msg_N - ("expect name of generic package in instantiation", Gen_Id); + + if From_With_Type (Gen_Unit) then + Error_Msg_N + ("cannot instantiate a limited withed package", Gen_Id); + else + Error_Msg_N + ("expect name of generic package in instantiation", Gen_Id); + end if; + Restore_Env; return; end if; |