Index: clang-tidy/modernize/MakeSmartPtrCheck.cpp =================================================================== --- clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -295,16 +295,8 @@ } return false; }; - // Check the implicit conversion from the std::initializer_list type to - // a class type. - if (IsStdInitListInitConstructExpr(Arg)) + if (IsStdInitListInitConstructExpr(Arg->IgnoreImplicit())) return false; - // The Arg can be a CXXBindTemporaryExpr, checking its underlying - // construct expr. - if (const auto * CTE = dyn_cast(Arg)) { - if (IsStdInitListInitConstructExpr(CTE->getSubExpr())) - return false; - } } } if (ArraySizeExpr.empty()) { Index: test/clang-tidy/modernize-make-unique.cpp =================================================================== --- test/clang-tidy/modernize-make-unique.cpp +++ test/clang-tidy/modernize-make-unique.cpp @@ -50,6 +50,7 @@ struct H { H(std::vector); + H(std::vector &, double); H(MyVector, int); }; @@ -344,6 +345,13 @@ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::make_unique instead // CHECK-FIXES: PH2.reset(new H({1, 2, 3}, 1)); + std::unique_ptr PH3 = std::unique_ptr(new H({1, 2, 3}, 1.0)); + // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: use std::make_unique instead + // CHECK-FIXES: std::unique_ptr PH3 = std::unique_ptr(new H({1, 2, 3}, 1.0)); + PH3.reset(new H({1, 2, 3}, 1.0)); + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::make_unique instead + // CHECK-FIXES: PH3.reset(new H({1, 2, 3}, 1.0)); + std::unique_ptr PI1 = std::unique_ptr(new I(G({1, 2, 3}))); // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: use std::make_unique instead // CHECK-FIXES: std::unique_ptr PI1 = std::make_unique(G({1, 2, 3}));