aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2020-05-12 08:20:22 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-07 05:26:56 -0400
commitdae09f9b557b1a38b4743a4213f7ca47c48eec81 (patch)
tree5d17435d142cd26e272731eb39e023a92f5994c7 /gcc/ada
parent572fa852f2f5cba25f70fc49c9bf18493433617c (diff)
downloadgcc-dae09f9b557b1a38b4743a4213f7ca47c48eec81.zip
gcc-dae09f9b557b1a38b4743a4213f7ca47c48eec81.tar.gz
gcc-dae09f9b557b1a38b4743a4213f7ca47c48eec81.tar.bz2
[Ada] Handle explicit dereferences in expression functions
gcc/ada/ * freeze.adb (Freeze_Expr_Types): Freeze the designated type of the explicit dereference.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/freeze.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 7df283a..fd76e7b 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -7934,6 +7934,15 @@ package body Freeze is
and then Node = Controlling_Argument (Parent (Node))
then
Check_And_Freeze_Type (Designated_Type (Etype (Node)));
+
+ -- An explicit dereference freezes the designated type as well,
+ -- even though that type is not attached to an entity in the
+ -- expression.
+
+ elsif Nkind (Node) in N_Has_Etype
+ and then Nkind (Parent (Node)) = N_Explicit_Dereference
+ then
+ Check_And_Freeze_Type (Designated_Type (Etype (Node)));
end if;
-- No point in posting several errors on the same expression