summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-11-06 11:55:32 -0600
committerAndreas Kling <kling@serenityos.org>2021-11-14 22:52:35 +0100
commit7014d37dd6e041b026ebf529f208a939bc759a69 (patch)
tree231ef3f4025ccbbcbcb24d2c7d76e6af32752a18 /AK
parent2b16ee742e88d589a307963e8eeb3413abd82c35 (diff)
downloadserenity-7014d37dd6e041b026ebf529f208a939bc759a69.zip
AK+Kernel: Suppress clang-tidy warnings from the cert-* category
cert-dcl50-cpp: No variadic functions, suppressed in RefCounted and ThreadSafeRefCounted for implementing the magic one_ref_left and will_be_destroyed functions. cert-dcl58-cpp: No opening ::std, suppressed in the places we put names in ::std to aid tools (move, forward, nullptr_t, align_val_t, etc).
Diffstat (limited to 'AK')
-rw-r--r--AK/RefCounted.h2
-rw-r--r--AK/StdLibExtras.h2
-rw-r--r--AK/Types.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/AK/RefCounted.h b/AK/RefCounted.h
index e954692b05..5d98811b0c 100644
--- a/AK/RefCounted.h
+++ b/AK/RefCounted.h
@@ -25,6 +25,7 @@ constexpr auto call_will_be_destroyed_if_present(const T* object) -> decltype(co
return {};
}
+// NOLINTNEXTLINE(cert-dcl50-cpp) variadic argument used to implement "is detected" pattern
constexpr auto call_will_be_destroyed_if_present(...) -> FalseType
{
return {};
@@ -37,6 +38,7 @@ constexpr auto call_one_ref_left_if_present(const T* object) -> decltype(const_c
return {};
}
+// NOLINTNEXTLINE(cert-dcl50-cpp) variadic argument used to implement "is detected" pattern
constexpr auto call_one_ref_left_if_present(...) -> FalseType
{
return {};
diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h
index 9a8928d641..a361b42fd0 100644
--- a/AK/StdLibExtras.h
+++ b/AK/StdLibExtras.h
@@ -21,7 +21,7 @@ constexpr auto round_up_to_power_of_two(T value, U power_of_two) requires(IsInte
//
// clang-format off
#ifndef AK_DONT_REPLACE_STD
-namespace std {
+namespace std { // NOLINT(cert-dcl58-cpp) Names in std to aid tools
// NOTE: These are in the "std" namespace since some compilers and static analyzers rely on it.
diff --git a/AK/Types.h b/AK/Types.h
index 6f99837508..8610a69e0d 100644
--- a/AK/Types.h
+++ b/AK/Types.h
@@ -61,7 +61,7 @@ constexpr u64 TiB = KiB * KiB * KiB * KiB;
constexpr u64 PiB = KiB * KiB * KiB * KiB * KiB;
constexpr u64 EiB = KiB * KiB * KiB * KiB * KiB * KiB;
-namespace std {
+namespace std { //NOLINT(cert-dcl58-cpp) nullptr_t must be in ::std:: for some analysis tools
using nullptr_t = decltype(nullptr);
}