diff options
author | fanquake <fanquake@gmail.com> | 2022-07-29 10:11:04 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-08-30 15:19:53 +0100 |
commit | f345dc3960c2cf4d69ebbcc011e4e836205f0361 (patch) | |
tree | 587ab3b52d7410679f08f255f66ae8135c8ffaec | |
parent | 94f2235f858bc4fdaf0ab0882599f6a228401cf5 (diff) | |
download | bitcoin-f345dc3960c2cf4d69ebbcc011e4e836205f0361.tar.xz |
tidy: enable bugprone-use-after-move
Will error with:
```bash
coins.cpp:102:22: error: 'coin' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
(uint32_t)coin.nHeight,
^
coins.cpp:96:21: note: move occurred here
it->second.coin = std::move(coin);
```
until #25663 is merged.
See:
https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone-use-after-move.html
-rw-r--r-- | src/.clang-tidy | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/.clang-tidy b/src/.clang-tidy index f59f80f8ce..8fcb30c8f8 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -1,6 +1,7 @@ Checks: ' -*, bugprone-argument-comment, +bugprone-use-after-move, misc-unused-using-decls, modernize-use-default-member-init, modernize-use-nullptr, @@ -11,6 +12,7 @@ readability-redundant-string-init, ' WarningsAsErrors: ' bugprone-argument-comment, +bugprone-use-after-move, misc-unused-using-decls, modernize-use-default-member-init, modernize-use-nullptr, |