From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 77B263857C52; Fri, 1 Oct 2021 06:16:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77B263857C52 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-4025] [Ada] Add missing guard before call to Interface_Present_In_Ancestor X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: f54be415c18a2cfb37152ed55666c7e766404e4e X-Git-Newrev: 3a81dbb618e3ac6cd42ac6f296a96296e099ac1f Message-Id: <20211001061613.77B263857C52@sourceware.org> Date: Fri, 1 Oct 2021 06:16:13 +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: Fri, 01 Oct 2021 06:16:13 -0000 https://gcc.gnu.org/g:3a81dbb618e3ac6cd42ac6f296a96296e099ac1f commit r12-4025-g3a81dbb618e3ac6cd42ac6f296a96296e099ac1f Author: Eric Botcazou Date: Thu Aug 12 18:12:40 2021 +0200 [Ada] Add missing guard before call to Interface_Present_In_Ancestor gcc/ada/ * sem_type.adb (Specific_Type): Check that the type is tagged before calling Interface_Present_In_Ancestor on it. Diff: --- gcc/ada/sem_type.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 3ca2e302a8e..8e5b067bb76 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -3424,7 +3424,8 @@ package body Sem_Type is -- Ada 2005 (AI-251): T1 is a concrete type that implements the -- class-wide interface T2 - elsif Is_Class_Wide_Type (T2) + elsif Is_Tagged_Type (T1) + and then Is_Class_Wide_Type (T2) and then Is_Interface (Etype (T2)) and then Interface_Present_In_Ancestor (Typ => T1, Iface => Etype (T2))