From 4efe11c6bcb6ba19745e98fae8887e3b4a978965 Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Mon, 16 Dec 2019 10:33:13 +0000 Subject: [PATCH] [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 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_ch12.adb | 6 ++++++ 2 files changed, 11 insertions(+) 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; ----------------------------------- -- 2.30.2