public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-10241] libstdc++: Fix PSTL test that fails in C++20 Date: Mon, 18 Mar 2024 14:05:06 +0000 (GMT) [thread overview] Message-ID: <20240318140506.16B94385840A@sourceware.org> (raw) https://gcc.gnu.org/g:ceb82ba594a6c24f33351eda0ae3fbb6fd6d841a commit r12-10241-gceb82ba594a6c24f33351eda0ae3fbb6fd6d841a Author: Jonathan Wakely <jwakely@redhat.com> 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. (cherry picked from commit f8403c43045cd56b5f775e1cf12a3f22feca4b58) 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; }
reply other threads:[~2024-03-18 14:05 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240318140506.16B94385840A@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).