aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2021-07-02 13:13:12 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-09-21 15:24:57 +0000
commit16e307b9a48813a08852fec16e77eb921db78b37 (patch)
tree4d04661ffb07d56ab2ea5e53c6a35ed2b3ed8b14
parentb23cdc01588b60f52a8c70c8f4465a068b49d317 (diff)
downloadgcc-16e307b9a48813a08852fec16e77eb921db78b37.zip
gcc-16e307b9a48813a08852fec16e77eb921db78b37.tar.gz
gcc-16e307b9a48813a08852fec16e77eb921db78b37.tar.bz2
[Ada] Interface behaves differently from abstract tagged null
gcc/ada/ * exp_ch6.adb (Expand_Simple_Function_Return): For explicit dereference of type conversion, enable code that ensures that the tag of the result is that of the result type.
-rw-r--r--gcc/ada/exp_ch6.adb4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 5055184..7717fa7 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -7437,6 +7437,10 @@ package body Exp_Ch6 is
and then not Is_Class_Wide_Type (Utyp)
and then (Nkind (Exp) in
N_Type_Conversion | N_Unchecked_Type_Conversion
+ or else (Nkind (Exp) = N_Explicit_Dereference
+ and then Nkind (Prefix (Exp)) in
+ N_Type_Conversion |
+ N_Unchecked_Type_Conversion)
or else (Is_Entity_Name (Exp)
and then Is_Formal (Entity (Exp))))
then