RedDocMD added a comment. Okay, this is alarming. The following code yields a leak warning:
#include <iostream> #include <memory> struct A { int field; A(int f = 0) : field{f} {} void foo() { std::cout << "Field: " << field << "\n"; } }; void foo() { int *raw = new int(10); std::cout << *raw << "\n"; } But the following doesn't: #include <iostream> #include <memory> struct A { int field; A(int f = 0) : field{f} {} void foo() { std::cout << "Field: " << field << "\n"; } }; void foo() { std::unique_ptr<A> P{new A(10)}; // <-- This is the additional line int *raw = new int(10); std::cout << *raw << "\n"; } So the mere presence of a `unique_ptr` seems to turn off/cripple the `MallocChecker`! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98726/new/ https://reviews.llvm.org/D98726 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits