From patchwork Tue Oct 4 09:11:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 58326 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 177643858299 for ; Tue, 4 Oct 2022 09:11:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 177643858299 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664874716; bh=ng4uo5X0fYvgGRbBtpjZ/zcdB7hQlSmGb8sMq5gm3ec=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=dcLQeFQQYyHZGJHtSWL7pCVNfvUzYiqx1NQCK/NbQldhQI1HQ3WtYvm7PwJmlNxNU 2xgUFrkRb6AKJ9uCVU0Q3U9rP73+h1UrUQYga4M5WiI7WYI7B+07lQr3RlPzyjioHL VSXUBHnXMdPfuJC8YiSfxfA2MQOe8+YRQezsmWVc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CF4933858401 for ; Tue, 4 Oct 2022 09:11:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF4933858401 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-113-roSgzXb5OtqLqMQ7y61fxg-1; Tue, 04 Oct 2022 05:11:11 -0400 X-MC-Unique: roSgzXb5OtqLqMQ7y61fxg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1AB32887401; Tue, 4 Oct 2022 09:11:11 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBB1440C6EC2; Tue, 4 Oct 2022 09:11:10 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2949B8xf3990297 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 4 Oct 2022 11:11:08 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2949B7in3990296; Tue, 4 Oct 2022 11:11:07 +0200 Date: Tue, 4 Oct 2022 11:11:07 +0200 To: Richard Biener , David Malcolm Subject: [PATCH] attribs: Add missing auto_diagnostic_group 3 times Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! In these spots, the error/error_at has some inform afterwards which are explanation part of the same diagnostics, so should be tied with auto_diagnostic_group with it. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2022-10-04 Jakub Jelinek * attribs.cc (handle_ignored_attributes_option, decl_attributes, common_function_versions): Use auto_diagnostic_group. Jakub --- gcc/attribs.cc.jj 2022-10-03 18:31:16.130032566 +0200 +++ gcc/attribs.cc 2022-10-03 21:27:02.364104260 +0200 @@ -251,6 +251,7 @@ handle_ignored_attributes_option (vec or %"); continue; @@ -732,6 +733,7 @@ decl_attributes (tree *node, tree attrib || (spec->max_length >= 0 && nargs > spec->max_length)) { + auto_diagnostic_group d; error ("wrong number of arguments specified for %qE attribute", name); if (spec->max_length < 0) @@ -1167,6 +1169,7 @@ common_function_versions (tree fn1, tree std::swap (fn1, fn2); attr1 = attr2; } + auto_diagnostic_group d; error_at (DECL_SOURCE_LOCATION (fn2), "missing % attribute for multi-versioned %qD", fn2);