From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 5C5143858005; Tue, 21 Sep 2021 15:26:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C5143858005 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3735] [Ada] Interface behaves differently from abstract tagged null X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/master X-Git-Oldrev: b23cdc01588b60f52a8c70c8f4465a068b49d317 X-Git-Newrev: 16e307b9a48813a08852fec16e77eb921db78b37 Message-Id: <20210921152629.5C5143858005@sourceware.org> Date: Tue, 21 Sep 2021 15:26:29 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2021 15:26:29 -0000 https://gcc.gnu.org/g:16e307b9a48813a08852fec16e77eb921db78b37 commit r12-3735-g16e307b9a48813a08852fec16e77eb921db78b37 Author: Javier Miranda Date: Fri Jul 2 13:13:12 2021 -0400 [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. Diff: --- gcc/ada/exp_ch6.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 50551847629..7717fa7c0ab 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