From: Viljar Indus <[email protected]>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/freeze.adb | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index fe6f11ff353..439462569bd 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -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;
-- 
2.51.0

Reply via email to