clang-analyzer is incorrectly raising NewDeleteLeaks warning. happens with-std=c++17 flag. Here is godbolt link showing the issue: https://godbolt.org/z/K88K86xrG
I have the same problem.
If I store result of make_shared into a variable and use this variable then - no leak report occurs.
But it is not a good solution.
For the following code:
std::shared_ptr create_sp() { return std::make_shared(10); }
std::vector<std::shared_ptr> f() { return {create_sp()}; }
clang-analyzer is incorrectly raising NewDeleteLeaks warning. happens with-std=c++17 flag. Here is godbolt link showing the issue: https://godbolt.org/z/K88K86xrG