$ cat makeuniquetest.cpp #include <memory> int main() { auto p = std::unique_ptr<int>{new int()}; p.reset(new int()); } clang-tidy warns about line 4, but not line 5: $ clang-tidy makeuniquetest.cpp -checks=-*,modernize-make-unique -- -std=c++14 1 warning generated. /makeuniquetest.cpp:4:14: warning: use std::make_unique instead [modernize-make-unique] auto p = std::unique_ptr<int>{new int()}; ^ std::make_unique ( ) Expected result after applying fixes: #include <memory> int main() { auto p = std::make_unique<int>(); p = std::make_unique<int>(); }
Fixed in https://reviews.llvm.org/rL285589