From patchwork Mon Nov 14 13:52:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 60596 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A68B538A8156 for ; Mon, 14 Nov 2022 13:56:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A68B538A8156 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668434219; bh=POijHYaDaN0yxyeLPHfrPmrf8gXHhvr8/BxRNhJc/oM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=s4G7ypkTYIdcyTFzRS0LRQha/dQA1yqpxEu27tPbqB9FjLDAOXAzXAFIZj8JDocS+ kC34Ker5U4PA4hzFWK+nf6vqGLq6QPiiAxbJ33QoTSQP8rmeWZ/yI2+4suuRR9fq37 ab304YdhvQ3tlZq9IJzqvYRbawK4qGgqkAJZ3tVE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 3CFF13851882 for ; Mon, 14 Nov 2022 13:52:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CFF13851882 Received: by mail-wm1-x32e.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso10733666wma.1 for ; Mon, 14 Nov 2022 05:52:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=POijHYaDaN0yxyeLPHfrPmrf8gXHhvr8/BxRNhJc/oM=; b=WBBOUvcTmfYNNJm1aHXXonr37Rh6vijJDxtmNS4jNjwfxhjksuVvsKiwDl3l+0dTf2 YZjq1d8K2j3qnH9/POcILgQBLmPSRNKFnUDSGT2hJzwTHFm5hOuPzbFOywkKtZPwBQvy dZ7j/cOLEQgC9xTSidfTcMnvqDDBQBQO6lev2DYipWqhTdmZk48BKfypUXbBCyW+NC3n 1xeboWt5AdzXeBgc/VNm9XAu2qrJN540v826T8PVBpV/AdE0vC2GGRH2pNX1/aJtKIrp 53Bd4WO9fl3AOPEgM9HnudGZ2qDnH8tAfD1kJmLsX1w7aOPsEcyzs9L7po8PVvq9n6bl i1QQ== X-Gm-Message-State: ANoB5plIECayy2p4jsMCLWoUzU7LHQ+n3qunbG3/GUUI0o5SOIk46F9e SNpOrzsAsgVDYelLtUwhNgG7CYOe0Vl8Zw== X-Google-Smtp-Source: AA0mqf6OjG98LCAI1fijX8VOskRA5dehZHf4dniJRqHpObVRxxlo4wLyPA94MNuOZnYqspT1U8N1iQ== X-Received: by 2002:a05:600c:4143:b0:3cf:931c:2bf6 with SMTP id h3-20020a05600c414300b003cf931c2bf6mr7851092wmm.98.1668433968122; Mon, 14 Nov 2022 05:52:48 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id j34-20020a05600c1c2200b003cf57329221sm19732987wms.14.2022.11.14.05.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 05:52:47 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [COMMITTED] ada: Flag unsupported dispatching constructor calls Date: Mon, 14 Nov 2022 14:52:45 +0100 Message-Id: <20221114135245.53157-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Javier Miranda gcc/ada/ * exp_intr.adb (Expand_Dispatching_Constructor_Call): Improve warning message. * freeze.adb (Check_No_Parts_Violations): Improve error message. Tested on x86_64-pc-linux-gnu, committed on master. --- 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