libstdc++: Fix tests with non-const operator==
These tests fail in strict -std=c++20 mode but their equality ops don't need to be non-const, it looks like an accident. This fixes two FAILs with -std=c++20: FAIL: 20_util/tuple/swap.cc (test for excess errors) FAIL: 26_numerics/valarray/87641.cc (test for excess errors) libstdc++-v3/ChangeLog: * testsuite/20_util/tuple/swap.cc (MoveOnly::operator==): Add const qualifier. * testsuite/26_numerics/valarray/87641.cc (X::operator==): Likewise.
This commit is contained in:
parent
f54ae4da1f
commit
fbad7a74aa
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ struct MoveOnly
|
|||
MoveOnly(MoveOnly const&) = delete;
|
||||
MoveOnly& operator=(MoveOnly const&) = delete;
|
||||
|
||||
bool operator==(MoveOnly const& m)
|
||||
bool operator==(MoveOnly const& m) const
|
||||
{ return i == m.i; }
|
||||
|
||||
void swap(MoveOnly& m)
|
||||
|
|
|
@ -39,7 +39,7 @@ struct X
|
|||
X() : val(1) { }
|
||||
|
||||
X& operator+=(const X& x) { val += x.val; return *this; }
|
||||
bool operator==(const X& x) { return val == x.val; }
|
||||
bool operator==(const X& x) const { return val == x.val; }
|
||||
|
||||
int val;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue