]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Update the message for -gnatwx switch
authorViljar Indus <indus@adacore.com>
Thu, 5 Jun 2025 12:06:26 +0000 (15:06 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 21 Nov 2025 08:29:36 +0000 (09:29 +0100)
Some messages triggered by this switch did not have the
gnatwx tag and were not treated as a continuation of the same
error message.

gcc/ada/ChangeLog:

* freeze.adb (Freeze_Profile): Improve -gnatwx message.

gcc/ada/freeze.adb

index fe6f11ff353c879303466bcc9ddbba254cd86331..439462569bd423cfe9e2cd4305652a7512836f39 100644 (file)
@@ -4872,16 +4872,19 @@ package body Freeze is
                if Nkind (Original_Node (Parent (E))) = N_Full_Type_Declaration
                then
                   Warn_Node := Parent (E);
-
-                  if Formal = First_Formal (E) then
-                     Error_Msg_NE ("??in inherited operation&", Warn_Node, E);
-                  end if;
                else
                   Warn_Node := Formal;
                end if;
 
                Error_Msg_NE ("?x?type of argument& is unconstrained array",
                   Warn_Node, Formal);
+
+               if Nkind (Original_Node (Parent (E))) = N_Full_Type_Declaration
+                 and then Formal = First_Formal (E)
+               then
+                  Error_Msg_NE ("\?x?in inherited operation&", Warn_Node, E);
+               end if;
+
                Error_Msg_N ("\?x?foreign caller must pass bounds explicitly",
                   Warn_Node);
                Error_Msg_Qual_Level := 0;