From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id C5A0C3858C2C; Tue, 9 Nov 2021 09:45:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5A0C3858C2C 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-5019] [Ada] Complete support for prefixed call on subtypes/derived types X-Act-Checkin: gcc X-Git-Author: Yannick Moy X-Git-Refname: refs/heads/master X-Git-Oldrev: 51ad879c72e77f8a4021256c4aaf5567c6f587cf X-Git-Newrev: ea8726cac5af33305fa81886beb4ab2255f99567 Message-Id: <20211109094544.C5A0C3858C2C@sourceware.org> Date: Tue, 9 Nov 2021 09:45:44 +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, 09 Nov 2021 09:45:44 -0000 https://gcc.gnu.org/g:ea8726cac5af33305fa81886beb4ab2255f99567 commit r12-5019-gea8726cac5af33305fa81886beb4ab2255f99567 Author: Yannick Moy Date: Tue Oct 26 12:21:40 2021 +0200 [Ada] Complete support for prefixed call on subtypes/derived types gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration, Derived_Type_Declaration): Initialize list of primitive operations when Extensions_Allowed. Diff: --- gcc/ada/sem_ch3.adb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index ff3da385943..e24ca8c6ce8 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -5755,6 +5755,15 @@ package body Sem_Ch3 is if Is_Tagged_Type (Id) then Set_No_Tagged_Streams_Pragma (Id, No_Tagged_Streams_Pragma (T)); + end if; + + -- For tagged types, or when prefixed-call syntax is allowed + -- for untagged types, initialize the list of primitive + -- operations to an empty list. + + if Is_Tagged_Type (Id) + or else Extensions_Allowed + then Set_Direct_Primitive_Operations (Id, New_Elmt_List); end if; @@ -17199,8 +17208,12 @@ package body Sem_Ch3 is Set_Etype (T, Any_Type); Set_Scalar_Range (T, Scalar_Range (Any_Type)); - if Is_Tagged_Type (T) - and then Is_Record_Type (T) + -- For tagged types, or when prefixed-call syntax is allowed for + -- untagged types, initialize the list of primitive operations to + -- an empty list. + + if (Is_Tagged_Type (T) and then Is_Record_Type (T)) + or else Extensions_Allowed then Set_Direct_Primitive_Operations (T, New_Elmt_List); end if;