From patchwork Wed Apr 19 08:14:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 85247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp206571vqo; Wed, 19 Apr 2023 01:14:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ap3DZ0OowmrX94eBGJEeJoc5BXUQ2kN8KkPkMsW7JPyXjZVQ3IOqwYTvHYCy2V4UNShQkY X-Received: by 2002:a05:6402:20e:b0:505:48c:3266 with SMTP id t14-20020a056402020e00b00505048c3266mr4373598edv.20.1681892098308; Wed, 19 Apr 2023 01:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681892098; cv=none; d=google.com; s=arc-20160816; b=Hbr/LehHAgDzXFJaQKm/p3lS4eEu0CUi9gpjUaB1kKxrjRWd+7mU34YIQpOXPjbFVm S/kRusuKqlQebvehJym0Id05x825e8JsZReB9mUlyULdw8OQQYhcgmDNf6dLRNAg0wV5 jO4DvQFiUGSi1MeQ/EJ/i0iMFiMIqLQNoWqNIvKMWJdE1FA9EIA7bgtyFR8lxMRgIuUT 7LxsMPkP/MQ3PzFjzqAfaxYre4p8HIZeuonLO4wmaKZkDU87AyYuHEiZXbSWizuMUY4J pQtz+QNyfEmYQI1LMX0lcNPuwiKFSI2GaKP9Ssa5VE7Q6EOH7oqAHo/aXimEq+BDcSG9 Z7NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=5rd6mdUTruOvIKURI6dfs3yUcMhwNNXiSyEBBfuLOvI=; b=Qi1Tp3mOgK4B0eXGu5EnwUQcK/lus6C0ZaOH2uu7/RzzssTls2mjbsfBnN+fgH9MZj yEKkU56BogEiNSt+Y4Ukrmv3HAilOuNmNEublTDqFm92cI+Coi3Ku950wcrOSLgWqEtz fRdUpPAjOePCeyVHzu8aUGehD6pNUzxf8NoAQ+hB2n4uSb/YLkaZ+IWHxolTgBkbBMm8 r++gZuqt8mZ9fo4+aKiulqtA9QAS28yVfjtHm6RaxfSdWWeLIh8ZrNffS+rT0gRqVIoK 28/RC/Vx8IWVFw9mwyX3mplxjnjSU8At2bkL/S3ZRpD5mdX8qA9K/Zvo+s3tLlUPNSvZ YJbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=J7SELomQ; 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 y20-20020a50e614000000b00504b45a5f90si15237536edm.242.2023.04.19.01.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:14:58 -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=J7SELomQ; 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 EE74C3858C60 for ; Wed, 19 Apr 2023 08:14:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE74C3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681892097; bh=5rd6mdUTruOvIKURI6dfs3yUcMhwNNXiSyEBBfuLOvI=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=J7SELomQyvyT9EqKJoPfvO/OaeM/Sl+C8PVhutdWmYQVQlGsj12P3RFOpa12dtTuP Q8A73NWdqw3W5vdg5xufEBtg/kpToaY+V9f6YomCDOTd9zCOeuUerCTlqxKEAR78Ct 4bnz8R+Y17fBiozvkCLXjlrqzzHxEA4OG+IVz7uY= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 416DF3858D1E for ; Wed, 19 Apr 2023 08:14:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 416DF3858D1E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-XzcFzOSbPZ-bVS4CgTe29g-1; Wed, 19 Apr 2023 04:14:09 -0400 X-MC-Unique: XzcFzOSbPZ-bVS4CgTe29g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6629738123B0; Wed, 19 Apr 2023 08:14:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BE46492B04; Wed, 19 Apr 2023 08:14:09 +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 33J8E18D2351118 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 19 Apr 2023 10:14:01 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 33J8E0e62351117; Wed, 19 Apr 2023 10:14:00 +0200 Date: Wed, 19 Apr 2023 10:14:00 +0200 To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Fix up pr109524.C for -std=c++23 [PR109524] Message-ID: References: <20230417084143.A57C2385783F@sourceware.org> MIME-Version: 1.0 In-Reply-To: <20230417084143.A57C2385783F@sourceware.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 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?1763591688869643598?= X-GMAIL-MSGID: =?utf-8?q?1763591688869643598?= On Mon, Apr 17, 2023 at 08:41:38AM +0000, Richard Biener via Gcc-patches wrote: > * g++.dg/pr109524.C: New testcase. This testcase was reduced such that it isn't valid C++23, so with my usual testing with GXX_TESTSUITE_STDS=98,11,14,17,20,2b it fails: FAIL: g++.dg/pr109524.C -std=gnu++2b (test for excess errors) .../gcc/testsuite/g++.dg/pr109524.C: In function 'nn hh(nn)': .../gcc/testsuite/g++.dg/pr109524.C:35:12: error: cannot bind non-const lvalue reference of type 'nn&' to an rvalue of type 'nn' .../gcc/testsuite/g++.dg/pr109524.C:17:6: note: initializing argument 1 of 'nn::nn(nn&)' The following patch fixes that and I've verified it doesn't change anything on what the test was testing, it still ICEs in r13-7198 and passes in r13-7203, now in all language modes (except for 98 where it is intentionally UNSUPPORTED). Tested on x86_64-linux -m32/-m64, committed to trunk and 13 branch as obvious. 2023-04-19 Jakub Jelinek PR tree-optimization/109524 * g++.dg/pr109524.C (nn::nn): Change argument type from nn & to const nn &. Jakub --- gcc/testsuite/g++.dg/pr109524.C.jj 2023-04-17 11:44:12.405551621 +0200 +++ gcc/testsuite/g++.dg/pr109524.C 2023-04-19 09:54:45.211210827 +0200 @@ -14,7 +14,7 @@ struct _Guard { }; struct nn { int * _M_dataplus; - nn(nn &) + nn(const nn &) { f(); _Guard __guard;