From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 179E2385843D; Mon, 14 Nov 2022 13:51:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 179E2385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668433914; bh=Tgxk1oBboC/YMawpELRaw1jTLfjRZ+87fa96y/MAq0s=; h=From:To:Subject:Date:From; b=opjv7kH/OqDck1sIE//fLMa5CIAuPon3S0Fe9TTcrNBz8oNDttPrP8eLmEgXx8ZDi caFSylpEah8GrDsW1fvFLrkWNHSEfA03CzWER1EHyjPYGcxOKoGM58nkSu3BKn3mRB nErWsgslngBFlXCrL1UeVCH9v6odM3fxxIhm5JIg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4015] ada: Flag unsupported dispatching constructor calls X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/master X-Git-Oldrev: f3597ba6c5ea9c0eb2c3dac7271f8a8bf9fbb220 X-Git-Newrev: 0e194d289d4d1c9aa16d14c4b94caf11c2506da3 Message-Id: <20221114135154.179E2385843D@sourceware.org> Date: Mon, 14 Nov 2022 13:51:54 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0e194d289d4d1c9aa16d14c4b94caf11c2506da3 commit r13-4015-g0e194d289d4d1c9aa16d14c4b94caf11c2506da3 Author: Javier Miranda Date: Mon Nov 7 09:28:56 2022 +0000 ada: Flag unsupported dispatching constructor calls gcc/ada/ * exp_intr.adb (Expand_Dispatching_Constructor_Call): Improve warning message. * freeze.adb (Check_No_Parts_Violations): Improve error message. Diff: --- gcc/ada/exp_intr.adb | 9 ++++++--- gcc/ada/freeze.adb | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index cb9b5be1090..d18ed69eeae 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -315,9 +315,12 @@ package body Exp_Intr is Error_Msg_N ("unsupported dispatching constructor call if the type " & "of the built object has task components??", N); - Error_Msg_N - ("\work around this problem by replacing task components " - & "with access-to-task-type components??", N); + + Error_Msg_Sloc := Sloc (Root_Type (Etype (Entity (Name (N))))); + Error_Msg_NE + ("\work around this by adding ''with no_task_parts'' to " + & "the declaration of the root type& defined#???", + N, Root_Type (Etype (Entity (Name (N))))); end if; end if; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 032c73d3dfb..7f78b4315a8 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -3188,6 +3188,9 @@ package body Freeze is if Has_Task (Typ) then Error_Msg_N ("aspect % applied to task type &", Typ); + Error_Msg_N + ("\replace task components with access-to-task-type " + & "components??", Typ); end if; else