From f32e1852694f714185e8b7ed16cc5fe6b70f7f11 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 31 Oct 2021 15:23:41 -0600 Subject: [PATCH] AK: Suppress false positive readability-non-const-parameter in Function In AK::Function::CallableWrapper::init_and_swap(), clang-tidy wants us to mark the destination argument as pointer to const, which doesn't work because we use placement new to construct a move'd *this into. --- AK/Function.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/Function.h b/AK/Function.h index a5bc0489f7..315743ee1a 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -156,6 +156,7 @@ private: delete this; } + // NOLINTNEXTLINE(readability-non-const-parameter) False positive; destination is used in a placement new expression void init_and_swap(u8* destination, size_t size) final override { VERIFY(size >= sizeof(CallableWrapper));