From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id A5A0E3857024; Thu, 1 Jun 2023 15:55:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5A0E3857024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685634951; bh=WlOw0Na319zHHYqT8UB03Y8ntehpUXuH/c9SW/7ctiY=; h=From:To:Subject:Date:From; b=w+KCDPLZMBIyK3AoeNFWN/8CTLGEAQ6Ns6NvIz75cMxBhec2AfHfgJyFbeRE/tFtp 9LRf9Ztltxyeq8ZT7P1L/oLVxwo2/l9PAyWSE3I53utE7lrzyOs4memeYj0WZjhg9s c0gjzGncXFQNinWaj3O0gsGmAnozRdbD5tf74rCU= 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 r14-1472] libstdc++: Fix PSTL test that fails in C++20 X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: fe94f8b7e022b7e154f6c47cc292d4463bddac5e X-Git-Newrev: f8403c43045cd56b5f775e1cf12a3f22feca4b58 Message-Id: <20230601155551.A5A0E3857024@sourceware.org> Date: Thu, 1 Jun 2023 15:55:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f8403c43045cd56b5f775e1cf12a3f22feca4b58 commit r14-1472-gf8403c43045cd56b5f775e1cf12a3f22feca4b58 Author: Jonathan Wakely Date: Thu Jun 1 16:49:53 2023 +0100 libstdc++: Fix PSTL test that fails in C++20 This test fails in C++20 and later due to a warning: warning: C++20 says that these are ambiguous, even though the second is reversed: note: candidate 1: 'bool MyClass::operator==(const MyClass&)' note: candidate 2: 'bool MyClass::operator==(const MyClass&)' (reversed) note: try making the operator a 'const' member function FAIL: 26_numerics/pstl/numeric_ops/transform_reduce.cc (test for excess errors) libstdc++-v3/ChangeLog: * testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc: Add const to equality operator. Diff: --- libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc index ec020b42bbb..bec1c141278 100644 --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc @@ -68,7 +68,7 @@ class MyClass } friend MyClass operator*(const MyClass& x, const MyClass& y) { return MyClass(x.my_field * y.my_field); } bool - operator==(const MyClass& in) + operator==(const MyClass& in) const { return my_field == in.my_field; }