aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-04-12 16:56:23 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-29 14:23:47 +0000
commit3307a681fe6883008495d686f3b357dcbfb9537c (patch)
tree4a8624380df05447788c061cc365810a8ae3876d
parent32638d4975f2768b25732f87b4708360117ef0fd (diff)
downloadgcc-3307a681fe6883008495d686f3b357dcbfb9537c.zip
gcc-3307a681fe6883008495d686f3b357dcbfb9537c.tar.gz
gcc-3307a681fe6883008495d686f3b357dcbfb9537c.tar.bz2
[Ada] More robust guard against cascaded errors with overlapping actuals
gcc/ada/ * sem_warn.adb (Warn_On_Overlapping_Actuals): Prevent cascaded errors once for the subprogram call, not for every pair of actual parameters.
-rw-r--r--gcc/ada/sem_warn.adb10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 23f2771..9e337f9 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3729,6 +3729,11 @@ package body Sem_Warn is
if Nkind (N) not in N_Subprogram_Call | N_Entry_Call_Statement then
return;
+
+ -- Guard against previous errors
+
+ elsif Error_Posted (N) then
+ return;
end if;
-- If a call C has two or more parameters of mode in out or out that are
@@ -3800,10 +3805,9 @@ package body Sem_Warn is
and then Is_Composite_Type (Etype (Form1)))
then
- -- Guard against previous errors
+ -- Guard against previous errors
- if Error_Posted (N)
- or else No (Etype (Act1))
+ if No (Etype (Act1))
or else No (Etype (Act2))
then
null;