Havok: Silence clang-tidy false positive warning for operator new

This commit is contained in:
Léo Lam 2021-12-18 14:49:59 +01:00
parent 778e51edb5
commit 80d80d9f48
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,8 @@ protected:
};
#define HK_DECLARE_CLASS_ALLOCATOR_IMPL(CLASS_TYPE, ALLOCATOR) \
/* clang-tidy fails to understand that the operator delete matches the operator new */ \
/* NOLINTNEXTLINE(misc-new-delete-overloads) */ \
HK_FORCE_INLINE void* operator new(hk_size_t nbytes) { \
if constexpr (std::is_base_of_v<hkReferencedObject, CLASS_TYPE>) { \
return hkMemoryRouter::getInstance().ALLOCATOR().blockAlloc(static_cast<int>(nbytes)); \