https://gcc.gnu.org/g:ad4c549ac201176288ffe60b54c4693a2b3b1a43

commit r15-3299-gad4c549ac201176288ffe60b54c4693a2b3b1a43
Author: Viljar Indus <in...@adacore.com>
Date:   Wed Jul 17 13:08:23 2024 +0300

    ada: Restructure continuation message for pretty printing
    
    Continuation messages should have the same location
    as the main message. If the goal is to point to a different
    location then Error_Msg_Sloc should be used to change
    the location of the continuation message.
    
    gcc/ada/
    
            * par-ch4.adb (P_Name): Use Error_Msg_Sloc for the location of the
            continuation message.

Diff:
---
 gcc/ada/par-ch4.adb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 8b491c2cfd79..e76b0d8bea67 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -218,6 +218,8 @@ package body Ch4 is
       Arg_List  : List_Id := No_List; -- kill junk warning
       Attr_Name : Name_Id := No_Name; -- kill junk warning
 
+      Error_Loc : Source_Ptr;
+
    begin
       --  Case of not a name
 
@@ -889,13 +891,16 @@ package body Ch4 is
          ("positional parameter association " &
            "not allowed after named one");
 
+      Error_Loc := Token_Ptr;
+
       Expr_Node := P_Expression_If_OK;
 
       --  Leaving the '>' in an association is not unusual, so suggest
       --  a possible fix.
 
       if Nkind (Expr_Node) = N_Op_Eq then
-         Error_Msg_N ("\maybe `='>` was intended", Expr_Node);
+         Error_Msg_Sloc := Sloc (Expr_Node);
+         Error_Msg ("\maybe `='>` was intended #", Error_Loc);
       end if;
 
       --  We go back to scanning out expressions, so that we do not get

Reply via email to