in template: call to '__builtin_operator_delete' selects non-usual deallocation function

Completed

Hi,

I keep getting this code-analysis warning pop-up in various random places:

"In template: call to '__builtin_operator_delete' selects non-usual deallocation function"

I'm not sure what's causing it, but it seems to happen more often in code that calls functions that return a std::vector, although I've seen it pop-up elsewhere too, eg: in my custom SharedPtr<> class.

I'm not using operator delete or in-place new or anything like that and so far I don't have a clue what's causing it.

 I've just been ignoring it and nothing bad seems to have happened, but it's starting to get annoying so I'd quite like to turn it off, however I can't seem to find the correct clang-tidy setting to disable - any ideas?

Bye,
Mark

 

2 comments
Comment actions Permalink

Hi,

take a look at this: https://youtrack.jetbrains.com/issue/CPP-29091/In-template-call-to-builtinoperatordelete-selects-non-usual-deallocation-function-gcc-12#focus=Comments-27-6067190.0-0

It gives following advice which worked for me:
"Adding -fsized-deallocation to clangd flags in Settings | Languages & Frameworks | C/C++ | Clangd should resolve the issue until the proper fix arrives."

1
Comment actions Permalink

It worked thanks!

 

0

Please sign in to leave a comment.