From patchwork Mon Oct 3 11:46:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp906698wrs; Mon, 3 Oct 2022 04:47:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TurDlr1T/DX0eQtvZL75VbOrIeSmmv5kNe9FIuAIUdQNSk/Jv8hg5ytlGhZH6MyzC/rdc X-Received: by 2002:a05:6402:11c8:b0:451:7220:6343 with SMTP id j8-20020a05640211c800b0045172206343mr17976762edw.184.1664797665363; Mon, 03 Oct 2022 04:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664797665; cv=none; d=google.com; s=arc-20160816; b=jxAb8TPBcFOngtDqiQD9yd8qXHe1pT+6AfZfi665S3NSrY7bD7NTqJPD45e+RxKWtJ dbqIUko4rGzeUPWl5YBED95sRObYtWhNDViD3qUrznqmPGocvgPomU7eJKxFF/Qez32X earrQgy1gqejw1zjpl4SmiLeLdHR901PYykYRaVWnLJvRFesOljjmCdIilVgzj3AuzF4 WyCtPfqizA3EVWfow2zLTIwXFZi8VaNbIQcbd+d9hL0iX1IIiBGD2AYx0egNkJevilg8 Gz1rHLr0/p8+/6bX/f/zpPHSIQkS24RK8dYJNaf7oayz7M7v0SiypuAf8gxoURbkOfN0 XB0w== 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-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=j19kOT9NuEF/2gOoHgXITssFtCyMDFb369lZVcj99kM=; b=svgfm+idMPlg3lWWmBXdl7o9EETCR2yCb4DzNah88VkNi+cHdMARlppNLjgq2rU9Na pdL+LOUMiCqgCUDfZ4HKmh3v8fpg3awQK5pC1mk3RbEi4ya0vLSVWyOHVz08FZlQZ6Uh EsIFq9kdhD62OmyI+amuSZk0cLmV5wdzsxsJNHNY8Xz9+FggOvIpCgm3dTyZlVhJ1g+N YH4JS0ySvbizxZQ7z8licBLAMuNWnJ0LlertskstQQEFg5bGWQqsas9Vpn1l1MOanuF7 yxXQAAlO1VIbc96TS5QJr3wjcU8NOVYh8L7r/nluphQxXTho36+mWKdF7mTwCnChp/nV VBpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qm69AWNL; 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 fj3-20020a1709069c8300b0078849a014e9si8641963ejc.196.2022.10.03.04.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 04:47:45 -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=qm69AWNL; 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 37501385380D for ; Mon, 3 Oct 2022 11:47:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37501385380D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664797650; bh=j19kOT9NuEF/2gOoHgXITssFtCyMDFb369lZVcj99kM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qm69AWNLStrPDdAkPDxqiTcoRRGYQHsHlzRA4caxjCak1FT6CRrfIq3e0+tcnCMzA r8SxCMl3ipQ0EC0K/oAbj13+UpFvsiqnR9mk7UJVrt3D+oNm0QRbZYAIcJoio8VzSU BejrcI9ET5mbivDCtkkFJ00btIc6MgpBK6NupiHs= 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 A3B973858D38 for ; Mon, 3 Oct 2022 11:46:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3B973858D38 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-587-AHx9aypQOC2Dr1-F40MbDw-1; Mon, 03 Oct 2022 07:46:44 -0400 X-MC-Unique: AHx9aypQOC2Dr1-F40MbDw-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 0CC4B185A7AD; Mon, 3 Oct 2022 11:46:44 +0000 (UTC) Received: from localhost (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8ED040C6EC2; Mon, 3 Oct 2022 11:46:43 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix tests broken by C++23 P2266R3 "Simpler implicit move" Date: Mon, 3 Oct 2022 12:46:41 +0100 Message-Id: <20221003114641.367692-1-jwakely@redhat.com> 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 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely 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?1745666876970251555?= X-GMAIL-MSGID: =?utf-8?q?1745666876970251555?= Tested x86_64-linux. Pushed to trunk. -- >8 -- In C++23 mode these tests started to FAIL because an rvalue reference parameter can no longer be bound to an lvalue reference return type. As confirmed by Ville (who added these tests) the problem overloads are not intended to be called, and only exist to verify that they don't interfere with the intended behaviour. This changes the function bodies to just throw, so that the tests will fail if the function is called. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_ostream/inserters_other/char/6.cc: Change body of unused operator<< overload to throw if called. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc: Likewise. --- .../testsuite/27_io/basic_ostream/inserters_other/char/6.cc | 2 +- .../testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/6.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/6.cc index f62023c8c2e..e45af3c02af 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/6.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/6.cc @@ -42,7 +42,7 @@ std::ostream& operator<<(std::ostream&, const X&) = delete; struct Y {}; std::ostream& operator<<(std::ostream& os, const Y&) {return os;} -std::ostream& operator<<(std::ostream&& os, const Y&) {return os;} +std::ostream& operator<<(std::ostream&& os, const Y&) {throw 1;} // not used struct Z{}; diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc index 6bbf4a7f341..7ef6442d358 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc @@ -42,7 +42,7 @@ std::wostream& operator<<(std::wostream&, const X&) = delete; struct Y {}; std::wostream& operator<<(std::wostream& os, const Y&) {return os;} -std::wostream& operator<<(std::wostream&& os, const Y&) {return os;} +std::wostream& operator<<(std::wostream&& os, const Y&) {throw 1;} // not used struct Z{};