Search code examples
clion

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


why am I getting such a static analyzer error, there are no errors when compiling
on version 2021.1 there was no such error

clangd v15.0.0 flags: -Wno-unused-variable,-Wno-infinite-recursion,-Werror=implicit-function-declaration,-Wshadow,-Wno-shadow-field-in-constructor-modified,-Wno-shadow-ivar,-Wuninitialized,-Wunused-label,-Wunused-lambda-capture

code: std::make_sharedhttplib::Server();
(also applies to std::regex, nlohmann::json)

screenshots:

code

clang settings


Solution

  • Seems to be a known problem. See here for a possible solution: https://youtrack.jetbrains.com/issue/CPP-29091/In-template-call-to-builtin-operator-delete-selects-non-usual-de#focus=Comments-27-6067190.0-0