mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
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).
This commit is contained in:
parent
2b16ee742e
commit
7014d37dd6
Notes:
sideshowbarker
2024-07-18 01:07:38 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/7014d37dd6e Pull-request: https://github.com/SerenityOS/serenity/pull/10737 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/PeterBindels-TomTom Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/dascandy Reviewed-by: https://github.com/trflynn89
5 changed files with 7 additions and 3 deletions
|
@ -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 {};
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ private:
|
|||
|
||||
// The C++ standard specifies that the nothrow allocation tag should live in the std namespace.
|
||||
// Otherwise, `new (std::nothrow)` calls wouldn't get resolved.
|
||||
namespace std {
|
||||
namespace std { // NOLINT(cert-dcl58-cpp) These declarations must be in ::std and we are not using <new>
|
||||
struct nothrow_t {
|
||||
explicit nothrow_t() = default;
|
||||
};
|
||||
|
|
|
@ -22,6 +22,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 {};
|
||||
|
@ -34,6 +35,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 {};
|
||||
|
|
Loading…
Reference in a new issue