summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yabin Cui <yabinc@google.com> 2023-06-21 13:43:03 -0700
committer Yabin Cui <yabinc@google.com> 2023-06-22 17:20:36 +0000
commit6d30df970f1ad209a87708fa03e8f746102fa42d (patch)
tree5feb062735061f976aae772468bb98d8bfd5cf9e
parent3fda3c86e182815349871932a2925f288cf26898 (diff)
Fix bugprone-use-after-move clang-tidy warning
After clang update, clang-tidy bugprone-use-after-move starts to check constructor initialization list. It gives below false-positive warning: art/compiler/utils/riscv64/assembler_riscv64.h:70:48: error: 'src' used after it was moved [bugprone-use-after-move,-warnings-as-errors] : Label(std::move(src)), prev_branch_id_(src.prev_branch_id_) {} ^ art/compiler/utils/riscv64/assembler_riscv64.h:70:9: note: move occurred here : Label(std::move(src)), prev_branch_id_(src.prev_branch_id_) {} ^ Bug: 286421006 Test: build with clang-r498229 Change-Id: I437e92095b60b3ef4baaabb4aeb667fe4375a471
-rw-r--r--compiler/utils/riscv64/assembler_riscv64.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/utils/riscv64/assembler_riscv64.h b/compiler/utils/riscv64/assembler_riscv64.h
index fc86d5808d..f7c37284eb 100644
--- a/compiler/utils/riscv64/assembler_riscv64.h
+++ b/compiler/utils/riscv64/assembler_riscv64.h
@@ -67,6 +67,7 @@ class Riscv64Label : public Label {
Riscv64Label() : prev_branch_id_(kNoPrevBranchId) {}
Riscv64Label(Riscv64Label&& src) noexcept
+ // NOLINTNEXTLINE - src.prev_branch_id_ is valid after the move
: Label(std::move(src)), prev_branch_id_(src.prev_branch_id_) {}
private: