From: Piotr Trojanek Date: Thu, 3 Jul 2025 08:10:56 +0000 (+0200) Subject: ada: Tune check for restriction No_Relative_Delay and call to Set_Handler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e533dbd8ce2b786c5c5d174b992197947fbd70d;p=thirdparty%2Fgcc.git ada: Tune check for restriction No_Relative_Delay and call to Set_Handler When checking restriction No_Relative_Delay and detecting calls to Ada.Real_Time.Timing_Events.Set_Handler with a Time_Span parameter, we looked at the exact type of the actual parameter, while we should look at its base type. This patch looks at the type of actual parameter like it is done in Expand_N_Delay_Until_Statement. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Call): Look at the base type of actual parameter when checking call to Set_Handler. --- diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index e44994a681d..29b77668802 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -7270,7 +7270,9 @@ package body Sem_Res is if Restriction_Check_Required (No_Relative_Delay) and then Is_RTE (Nam, RE_Set_Handler) - and then Is_RTE (Etype (Next_Actual (First_Actual (N))), RE_Time_Span) + and then + Is_RTE + (Base_Type (Etype (Next_Actual (First_Actual (N)))), RE_Time_Span) then Check_Restriction (No_Relative_Delay, N); end if;