https://gcc.gnu.org/g:7e533dbd8ce2b786c5c5d174b992197947fbd70d

commit r16-2406-g7e533dbd8ce2b786c5c5d174b992197947fbd70d
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Thu Jul 3 10:10:56 2025 +0200

    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:
---
 gcc/ada/sem_res.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index e44994a681d7..29b776688023 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;

Reply via email to