From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 5B4A738A9402; Tue, 11 Jan 2022 13:28:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B4A738A9402 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-6469] [Ada] Task arrays trigger spurious unreferenced warnings X-Act-Checkin: gcc X-Git-Author: Justin Squirek X-Git-Refname: refs/heads/master X-Git-Oldrev: ce263de61fb0817d4d5adcb740e1b08dbd7bb6b4 X-Git-Newrev: 1be42e5907524af490afdec8ff2e200e69bfa8aa Message-Id: <20220111132831.5B4A738A9402@sourceware.org> Date: Tue, 11 Jan 2022 13:28:31 +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, 11 Jan 2022 13:28:31 -0000 https://gcc.gnu.org/g:1be42e5907524af490afdec8ff2e200e69bfa8aa commit r12-6469-g1be42e5907524af490afdec8ff2e200e69bfa8aa Author: Justin Squirek Date: Tue Dec 28 19:32:51 2021 +0000 [Ada] Task arrays trigger spurious unreferenced warnings gcc/ada/ * sem_warn.adb (Check_References): Add call to Has_Task instead of checking component type. Diff: --- gcc/ada/sem_warn.adb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 72627af6121..e02f6e04947 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1701,13 +1701,10 @@ package body Sem_Warn is and then Ekind (E1) /= E_Constant and then Ekind (E1) /= E_Component) - -- Check that E1T is not a task or an array of them + -- Check that E1T is not a task or a composite type + -- with a task component. - or else not - (Is_Task_Type (E1T) - or else (Ekind (E1T) in Array_Kind - and then Is_Task_Type - (Component_Type (E1T))))) + or else not Has_Task (E1T)) -- For subunits, only place warnings on the main unit itself, -- since parent units are not completely compiled.