Index: clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -292,12 +292,13 @@ // Foo{1} => false auto HasListIntializedArgument = [](const CXXConstructExpr *CE) { for (const auto *Arg : CE->arguments()) { + Arg = Arg->IgnoreImplicit(); + if (isa(Arg) || isa(Arg)) return true; // Check whether we implicitly construct a class from a // std::initializer_list. - if (const auto *ImplicitCE = - dyn_cast(Arg->IgnoreImplicit())) { + if (const auto *ImplicitCE = dyn_cast(Arg)) { if (ImplicitCE->isStdInitListInitialization()) return true; } Index: clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique.cpp =================================================================== --- clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique.cpp +++ clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique.cpp @@ -273,6 +273,14 @@ // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use std::make_unique instead // CHECK-FIXES: std::make_unique(APair{T, 1}); + // Check aggregate init with intermediate temporaries. + std::unique_ptr PAggrTemp = std::unique_ptr(new APair({T, 1})); + // CHECK-MESSAGES: :[[@LINE-1]]:38: warning: use std::make_unique instead + // CHECK-FIXES: std::unique_ptr PAggrTemp = std::unique_ptr(new APair({T, 1})); + PAggrTemp.reset(new APair({T, 1})); + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::make_unique instead + // CHECK-FIXES: PAggrTemp.reset(new APair({T, 1})); + // Test different kinds of initialization of the pointee, when the unique_ptr // is initialized with braces.