Tracing: coins.cpp:102:22: error: 'coin' used after it was moved [bugprone-use-after-move] #25640

issue MarcoFalke opened this issue on July 19, 2022
  1. MarcoFalke commented at 9:18 AM on July 19, 2022: member

    This may be fine because int values aren't touched by a std::move, but it seems brittle and confusing:

    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);
                        ^
    
  2. MarcoFalke added the label Refactoring on Jul 19, 2022
  3. rodentrabies cross-referenced this on Jul 21, 2022 from issue tracing: do not use `coin` after move in `CCoinsViewCache::AddCoin` by rodentrabies
  4. fanquake cross-referenced this on Jul 29, 2022 from issue tidy: enable bugprone-use-after-move by fanquake
  5. MarcoFalke referenced this in commit f5eadcb148 on Aug 1, 2022
  6. MarcoFalke closed this on Aug 1, 2022

  7. sidhujag referenced this in commit ce9edec74b on Aug 1, 2022
  8. MarcoFalke referenced this in commit 52dcb1d2a3 on Aug 30, 2022
  9. sidhujag referenced this in commit 1ed11c09ae on Aug 31, 2022
  10. PastaPastaPasta referenced this in commit 48b85e3744 on Oct 18, 2022
  11. bitcoin locked this on Aug 1, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC