aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-06-03 12:27:43 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-15 09:42:51 -0400
commitd15dc6fb72720d3ff499e2da9ba43eceaf4a8b04 (patch)
tree9e35e80a2b54cc0983ddd51c7df284e0407ecc99 /gcc/ada/sem_res.adb
parent00847335c80917e731f2999bf447319290c70718 (diff)
downloadgcc-d15dc6fb72720d3ff499e2da9ba43eceaf4a8b04.zip
gcc-d15dc6fb72720d3ff499e2da9ba43eceaf4a8b04.tar.gz
gcc-d15dc6fb72720d3ff499e2da9ba43eceaf4a8b04.tar.bz2
[Ada] Assert failure with -gnatwr
gcc/ada/ * sem_res.adb (Resolve_Type_Conversion): Protect against null entity. Add proper tag for -gnatwr warning.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 8b2f23c..f1c0177 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -11679,6 +11679,7 @@ package body Sem_Res is
-- odd subtype coming from the bounds).
if (Is_Entity_Name (Orig_N)
+ and then Present (Entity (Orig_N))
and then
(Etype (Entity (Orig_N)) = Orig_T
or else
@@ -11733,17 +11734,15 @@ package body Sem_Res is
-- entity, give the name of the entity in the message. If not,
-- just mention the expression.
- -- Shoudn't we test Warn_On_Redundant_Constructs here ???
-
else
if Is_Entity_Name (Orig_N) then
Error_Msg_Node_2 := Orig_T;
Error_Msg_NE -- CODEFIX
- ("??redundant conversion, & is of type &!",
+ ("?r?redundant conversion, & is of type &!",
N, Entity (Orig_N));
else
Error_Msg_NE
- ("??redundant conversion, expression is of type&!",
+ ("?r?redundant conversion, expression is of type&!",
N, Orig_T);
end if;
end if;