|
2 | 2 | // Distributed under the MIT software license, see the accompanying
|
3 | 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
4 | 4 |
|
5 |
| -#include <arith_uint256.h> |
6 | 5 | #include <streams.h>
|
7 | 6 | #include <test/util/setup_common.h>
|
8 | 7 | #include <uint256.h>
|
@@ -245,38 +244,6 @@ BOOST_AUTO_TEST_CASE(methods) // GetHex SetHexDeprecated FromHex begin() end() s
|
245 | 244 | ss.clear();
|
246 | 245 | }
|
247 | 246 |
|
248 |
| -BOOST_AUTO_TEST_CASE( operator_with_self ) |
249 |
| -{ |
250 |
| - |
251 |
| -/* Clang 16 and earlier detects v -= v and v /= v as self-assignments |
252 |
| - to 0 and 1 respectively. |
253 |
| - See: https://github.com/llvm/llvm-project/issues/42469 |
254 |
| - and the fix in commit c5302325b2a62d77cf13dd16cd5c19141862fed0 . |
255 |
| -
|
256 |
| - This makes some sense for arithmetic classes, but could be considered a bug |
257 |
| - elsewhere. Disable the warning here so that the code can be tested, but the |
258 |
| - warning should remain on as there will likely always be a better way to |
259 |
| - express this. |
260 |
| -*/ |
261 |
| - |
262 |
| -#if defined(__clang__) |
263 |
| -# pragma clang diagnostic push |
264 |
| -# pragma clang diagnostic ignored "-Wself-assign-overloaded" |
265 |
| -#endif |
266 |
| - arith_uint256 v{2}; |
267 |
| - v *= v; |
268 |
| - BOOST_CHECK_EQUAL(v, arith_uint256{4}); |
269 |
| - v /= v; |
270 |
| - BOOST_CHECK_EQUAL(v, arith_uint256{1}); |
271 |
| - v += v; |
272 |
| - BOOST_CHECK_EQUAL(v, arith_uint256{2}); |
273 |
| - v -= v; |
274 |
| - BOOST_CHECK_EQUAL(v, arith_uint256{0}); |
275 |
| -#if defined(__clang__) |
276 |
| -# pragma clang diagnostic pop |
277 |
| -#endif |
278 |
| -} |
279 |
| - |
280 | 247 | /**
|
281 | 248 | * Implemented as a templated function so it can be reused by other classes that have a FromHex()
|
282 | 249 | * method that wraps base_blob::FromHex(), such as transaction_identifier::FromHex().
|
|
0 commit comments