Disable check for false-positive 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/libartbase/base/scoped_arena_allocator.cc:122:20: error: 'other' used after it
was moved [bugprone-use-after-move,-warnings-as-errors]
arena_stack_(other.arena_stack_),
^
art/libartbase/base/scoped_arena_allocator.cc:119:7: note: move occurred here
: DebugStackReference(std::move(other)),
^
This CL disable the check in the code.
Bug: 286421006
Test: build with clang-r498229
Change-Id: Icac433d9bf1600546b5f7cf7bc6c520d61d020c2
diff --git a/libartbase/base/scoped_arena_allocator.cc b/libartbase/base/scoped_arena_allocator.cc
index 32de97a..f4c1aa7 100644
--- a/libartbase/base/scoped_arena_allocator.cc
+++ b/libartbase/base/scoped_arena_allocator.cc
@@ -118,15 +118,15 @@
ScopedArenaAllocator::ScopedArenaAllocator(ScopedArenaAllocator&& other) noexcept
: DebugStackReference(std::move(other)),
DebugStackRefCounter(),
+ // NOLINTBEGIN(bugprone-use-after-move) - the accessed fields are still valid after the move
ArenaAllocatorStats(other),
arena_stack_(other.arena_stack_),
mark_arena_(other.mark_arena_),
mark_ptr_(other.mark_ptr_),
mark_end_(other.mark_end_) {
- // NOLINTBEGIN - both ref_count_ and arena_stack_ are still valid after the move
other.DebugStackRefCounter::CheckNoRefs();
other.arena_stack_ = nullptr;
- // NOLINTEND
+ // NOLINTEND(bugprone-use-after-move)
}
ScopedArenaAllocator::ScopedArenaAllocator(ArenaStack* arena_stack)