From: Ghjuvan Lacambre Date: Mon, 16 Dec 2019 10:33:13 +0000 (+0000) Subject: [Ada] Validate_Access_Subprogram_Instance: check if not null types match X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4efe11c6bcb6ba19745e98fae8887e3b4a978965;p=gcc.git [Ada] Validate_Access_Subprogram_Instance: check if not null types match 2019-12-16 Ghjuvan Lacambre gcc/ada/ * sem_ch12.adb (Validate_Access_Subprogram_Instance): Add Can_Never_Be_Null checks. From-SVN: r279413 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 58517e6101f..f110a9b9c08 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-12-16 Ghjuvan Lacambre + + * sem_ch12.adb (Validate_Access_Subprogram_Instance): Add + Can_Never_Be_Null checks. + 2019-12-16 Eric Botcazou * doc/gnat_rm/implementation_defined_pragmas.rst (VFA): Document diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d405297ef35..5b7ce936281 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -12303,6 +12303,12 @@ package body Sem_Ch12 is Error_Msg_NE ("actual for formal & must have convention %", Actual, Gen_T); end if; + + if Can_Never_Be_Null (A_Gen_T) /= Can_Never_Be_Null (Act_T) then + Error_Msg_NE + ("non null exclusion of actual and formal & do not match", + Actual, Gen_T); + end if; end Validate_Access_Subprogram_Instance; -----------------------------------