Skip to content

Commit fa0fa0f

Browse files
author
MarcoFalke
committed
refactor: Revert "disable self-assign warning for tests"
This reverts commit 53372f2.
1 parent faed118 commit fa0fa0f

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/test/arith_uint256_tests.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -580,20 +580,6 @@ BOOST_AUTO_TEST_CASE(conversion)
580580

581581
BOOST_AUTO_TEST_CASE(operator_with_self)
582582
{
583-
/* Clang 16 and earlier detects v -= v and v /= v as self-assignments
584-
to 0 and 1 respectively.
585-
See: https://github.com/llvm/llvm-project/issues/42469
586-
and the fix in commit c5302325b2a62d77cf13dd16cd5c19141862fed0 .
587-
588-
This makes some sense for arithmetic classes, but could be considered a bug
589-
elsewhere. Disable the warning here so that the code can be tested, but the
590-
warning should remain on as there will likely always be a better way to
591-
express this.
592-
*/
593-
#if defined(__clang__)
594-
#pragma clang diagnostic push
595-
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
596-
#endif
597583
arith_uint256 v{2};
598584
v *= v;
599585
BOOST_CHECK_EQUAL(v, arith_uint256{4});
@@ -603,9 +589,6 @@ BOOST_AUTO_TEST_CASE(operator_with_self)
603589
BOOST_CHECK_EQUAL(v, arith_uint256{2});
604590
v -= v;
605591
BOOST_CHECK_EQUAL(v, arith_uint256{0});
606-
#if defined(__clang__)
607-
#pragma clang diagnostic pop
608-
#endif
609592
}
610593

611594
BOOST_AUTO_TEST_SUITE_END()

src/test/fuzz/muhash.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,7 @@ FUZZ_TARGET(muhash)
199199
},
200200
[&] {
201201
// Test that dividing a MuHash by itself brings it back to its initial state
202-
203-
// See note about clang + self-assignment in test/uint256_tests.cpp
204-
#if defined(__clang__)
205-
# pragma clang diagnostic push
206-
# pragma clang diagnostic ignored "-Wself-assign-overloaded"
207-
#endif
208-
209202
muhash /= muhash;
210-
211-
#if defined(__clang__)
212-
# pragma clang diagnostic pop
213-
#endif
214-
215203
muhash.Finalize(out);
216204
out2 = initial_state_hash;
217205
},

0 commit comments

Comments
 (0)