https://gcc.gnu.org/g:4a45c99302b688cacf788946b9a88ea8593bb395

commit r15-477-g4a45c99302b688cacf788946b9a88ea8593bb395
Author: Ronan Desplanques <desplanq...@adacore.com>
Date:   Mon Feb 19 17:19:27 2024 +0100

    ada: Fix crash with -gnatdJ and -gnatf
    
    This patch fixes a crash when the compiler emits a warning about
    an unchecked conversion and -gnatdJ is enabled.
    
    gcc/ada/
    
            * sem_ch13.adb (Validate_Unchecked_Conversions): Add node
            parameters to Error_Msg calls.

Diff:
---
 gcc/ada/sem_ch13.adb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 0470ce10ac7a..1ad5c4c0128f 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -18401,7 +18401,8 @@ package body Sem_Ch13 is
                      Error_Msg_Uint_1 := Source_Siz;
                      Error_Msg_Name_2 := Chars (Target);
                      Error_Msg_Uint_2 := Target_Siz;
-                     Error_Msg ("\size of % is ^, size of % is ^?z?", Eloc);
+                     Error_Msg
+                       ("\size of % is ^, size of % is ^?z?", Eloc, Act_Unit);
 
                      Error_Msg_Uint_1 := UI_Abs (Source_Siz - Target_Siz);
 
@@ -18412,17 +18413,17 @@ package body Sem_Ch13 is
                         if Source_Siz > Target_Siz then
                            Error_Msg
                              ("\?z?^ high order bits of source will "
-                              & "be ignored!", Eloc);
+                              & "be ignored!", Eloc, Act_Unit);
 
                         elsif Is_Unsigned_Type (Source) then
                            Error_Msg
                              ("\?z?source will be extended with ^ high order "
-                              & "zero bits!", Eloc);
+                              & "zero bits!", Eloc, Act_Unit);
 
                         else
                            Error_Msg
                              ("\?z?source will be extended with ^ high order "
-                              & "sign bits!", Eloc);
+                              & "sign bits!", Eloc, Act_Unit);
                         end if;
 
                      elsif Source_Siz < Target_Siz then

Reply via email to