From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id EF91D385480D; Mon, 3 Oct 2022 11:45:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF91D385480D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664797512; bh=F9lgXv/wUBtjWcb0GctMSTgyO453kZ49UlNAmt2sXRs=; h=From:To:Subject:Date:From; b=eIIaXD5A3L0XY0G3bt6gUHY1+zf2cNeHlaW/3e9fFrcK3Md12YuFQTnDhg7+XXYLQ gjS1QAXE8tN8rKUALDIi56mFJCYgL9I9tHEknNMU8s+YlE9/MU9ViqPcprhWnQ57bs lXP/BOIDymMpVE4BdVzXK3JDinvehuydRkaCqkpM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-3028] libstdc++: Fix tests broken by C++23 P2266R3 "Simpler implicit move" X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: c0129d6b2a5f2b3cfedd213d48c95581f75312aa X-Git-Newrev: 866263a5fe0d657cb9ec06d01bbc100900159036 Message-Id: <20221003114512.EF91D385480D@sourceware.org> Date: Mon, 3 Oct 2022 11:45:12 +0000 (GMT) List-Id: https://gcc.gnu.org/g:866263a5fe0d657cb9ec06d01bbc100900159036 commit r13-3028-g866263a5fe0d657cb9ec06d01bbc100900159036 Author: Jonathan Wakely Date: Mon Oct 3 12:10:07 2022 +0100 libstdc++: Fix tests broken by C++23 P2266R3 "Simpler implicit move" 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. Diff: --- libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/6.cc | 2 +- libstdc++-v3/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{};