diff options
author | Ed Schonberg <schonberg@adacore.com> | 2020-05-12 08:20:22 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-07 05:26:56 -0400 |
commit | dae09f9b557b1a38b4743a4213f7ca47c48eec81 (patch) | |
tree | 5d17435d142cd26e272731eb39e023a92f5994c7 /gcc/ada | |
parent | 572fa852f2f5cba25f70fc49c9bf18493433617c (diff) | |
download | gcc-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.adb | 9 |
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 |