aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-02-19 11:17:51 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-16 10:49:28 +0200
commitf03905788cbe2799a692b1f2435020b26a5a2574 (patch)
treef4bdcb35cffacecb59d8053c8c2dfaa0a402c122
parenta58b6be7f38e7a775f92b8aaa8d1c374a6e0c790 (diff)
downloadgcc-f03905788cbe2799a692b1f2435020b26a5a2574.zip
gcc-f03905788cbe2799a692b1f2435020b26a5a2574.tar.gz
gcc-f03905788cbe2799a692b1f2435020b26a5a2574.tar.bz2
ada: Fix crash with -gnatdJ and -gnatw_q
This commit makes the emission of -gnatw_q warnings pass node information so as to handle the enclosing subprogram display of -gnatdJ instead of crashing. gcc/ada/ * exp_ch4.adb (Expand_Composite_Equality): Call Error_Msg_N instead of Error_Msg.
-rw-r--r--gcc/ada/exp_ch4.adb8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 762e756..7a20036 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -2340,12 +2340,12 @@ package body Exp_Ch4 is
pragma Assert
(Is_First_Subtype (Outer_Type)
or else Is_Generic_Actual_Type (Outer_Type));
- Error_Msg_Node_1 := Outer_Type;
Error_Msg_Node_2 := Comp_Type;
- Error_Msg
- ("?_q?""="" for type & uses predefined ""="" for }", Loc);
+ Error_Msg_N
+ ("?_q?""="" for type & uses predefined ""="" for }",
+ Outer_Type);
Error_Msg_Sloc := Sloc (Op);
- Error_Msg ("\?_q?""="" # is ignored here", Loc);
+ Error_Msg_N ("\?_q?""="" # is ignored here", Outer_Type);
end if;
end;