From: Viljar Indus Date: Wed, 17 Jul 2024 10:08:23 +0000 (+0300) Subject: ada: Restructure continuation message for pretty printing X-Git-Tag: basepoints/gcc-16~6254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad4c549ac201176288ffe60b54c4693a2b3b1a43;p=thirdparty%2Fgcc.git 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 --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 8b491c2cfd7..e76b0d8bea6 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