===================================================================
@@ -25,6 +25,7 @@
with Atree; use Atree;
with Debug; use Debug;
+with Errout; use Errout;
with Lib; use Lib;
with Lib.Util; use Lib.Util;
with Namet; use Namet;
@@ -495,13 +496,15 @@
-- levels (through the pragma argument association) to get to
-- the pragma node itself. For the guard on a select
-- alternative, we do not have access to the token location
- -- for the WHEN, so we use the sloc of the condition itself.
+ -- for the WHEN, so we use the first sloc of the condition
+ -- itself (note: we use First_Sloc, not Sloc, because this is
+ -- what is referenced by dominance markers).
if Nkind_In (Parent (N), N_Accept_Alternative,
N_Delay_Alternative,
N_Terminate_Alternative)
then
- Loc := Sloc (N);
+ Loc := First_Sloc (N);
else
Loc := Sloc (Parent (Parent (N)));
end if;