[cfe-users] misc-new-delete-overloads

Tom Hulton-Harrop via cfe-users cfe-users at lists.llvm.org
Mon Dec 24 01:13:48 PST 2018


Hi there,

Apologies if this is the wrong place to ask about this - if it is I'd be
very grateful if you'd point me in the right direction :)

I'm seeing the clang-tidy warning 'misc-new-delete-overloads' when using
the two parameter version of class member delete, however when using the
single parameter version the warning goes away.

class Type
{
    void* operator new(size_t) { ... }
    void operator delete(void*) { ... } // no warning
    void operator delete (void*, size_t) { ... } // warning
};

When using the second version I don't think this warning should be
reported. Is this correct or am I missing something?

I've been double checking things here:

https://en.cppreference.com/w/cpp/memory/new/operator_new (Items 15, 16)
https://en.cppreference.com/w/cpp/memory/new/operator_delete (Items 17, 18
and 21, 22)

I'm using clang on Windows and using Clang Power Tools in Visual Studio to
invoke clang-tidy.

Any info would be greatly appreciated!

Thank you for your time,


Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20181224/8e487c4c/attachment.html>


More information about the cfe-users mailing list