[clang-tidy] `bugprone-use-after-move`: Fix handling of moves in lambda captures
authorMartin Boehme <mboehme@google.com>
Fri, 3 Jun 2022 07:08:17 +0000 (09:08 +0200)
committerMartin Boehme <mboehme@google.com>
Fri, 3 Jun 2022 07:34:09 +0000 (09:34 +0200)
commit8b90b2539048a581052a4b0d7628ffba0cd582a9
tree669659da5a0292367dc95002b07947a45ad50a28
parentdf0f30dc36c1703ad1fbefda90d74ca40f207077
[clang-tidy] `bugprone-use-after-move`: Fix handling of moves in lambda captures

Previously, we were treating a move in the lambda capture as if it happened
within the body of the lambda, not within the function that defines the lambda.

This fixes the same bug as https://reviews.llvm.org/D119165 (which it appears
may have been abandoned by the author?) but does so more simply.

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D126780
clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp