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: 1675 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp32272wrs; Tue, 4 Oct 2022 02:12:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xFJyrcoli2+WoRvvsRSdmuhqqgoT8+zwHV5RGftAdq7F1cJDaM9eeCbv3VYzA/eF6zsAP X-Received: by 2002:a17:907:75c1:b0:783:a2c1:860a with SMTP id jl1-20020a17090775c100b00783a2c1860amr18583152ejc.641.1664874731143; Tue, 04 Oct 2022 02:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664874731; cv=none; d=google.com; s=arc-20160816; b=e627uicvDgIkRdniwyKLcWLqgpuZWf6ZQdEwib8VnTn2UXm351Z1rIXdCkqvMscmlV NjzyaX2gIqwHOkf1MzHLxMmbaHc3v/7z6pjtr5P3ccaYcIY+4l366hMM7vY5z4j3wzih 9r46C6Xku6TFhgCxn9zZDnbPNKsP96Zq8Tz3/Ys/4fnlsu5hzshQVWIvJ+MyaXJtYU7A t8h0+IH//zh6J3yyVQo7jp3dyyhvWnsLRWmNTziYOTpEtd8cddtBSBi9Rj/usACH2uJN vhrunSgRHJXt6iQ8KswmerRddeN+jMsPyqNm0RpSRXvJcWnGjJB0qCB0FWgQpdxbyAMW sCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ng4uo5X0fYvgGRbBtpjZ/zcdB7hQlSmGb8sMq5gm3ec=; b=0WFol0CDbYEGUQhXzKKNHX7KBNk4nkZsUNQCQXx4FhoO9i2SvP3Ppu1GkE81cY7piO h+jdSg/iHo05ExN+FeQtM+ZpsBSSsZzYOQEYj7eS/PPa7uCXH6RkXvBK/yu4x+5KTm4t beQ+1UXJdkvuTb3WrnOB9N4jaLpHqFRWE1/4woCFpWrxxR5XxIbI0mnOxBQXqW/1HFxF K9V2g8K453Sqqrh9JDgeOXS/LzULWLsidYWV6op64wy86oSJZb7g8Xnyt4kVcJAlnMkr gJtxp5IDZcSD67qEupbl6g/s4JxTVdqxpRqm6w5JQN0qMB37oqBrNsP6CiAq9HCHfcme 6aqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gEC3uClK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ht13-20020a170907608d00b007832270e889si11174722ejc.90.2022.10.04.02.12.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 02:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gEC3uClK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA705385802E for ; Tue, 4 Oct 2022 09:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA705385802E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664874730; 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=gEC3uClKHWl5YtSwHcMVVtI+C/noM9BFIPHqcua9WJbPLRJ56CQ00DNrYJHoEjJ/G DcBRDfo11d46A4uNUIymTZBFG92+4VkRTmoYIRuAzG202FWNAMGS6ZMfE1lj1uDqHg XwnzYURbVB36/3glBttdivGb74VCm/DGsibGcsb4= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745747686329689754?= X-GMAIL-MSGID: =?utf-8?q?1745747686329689754?= 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);