Index: clang-tidy/modernize/MakeUniqueCheck.cpp =================================================================== --- clang-tidy/modernize/MakeUniqueCheck.cpp +++ clang-tidy/modernize/MakeUniqueCheck.cpp @@ -42,9 +42,10 @@ qualType(equalsBoundNode( PointerType))))))))))))))), argumentCountIs(1), - hasArgument(0, cxxNewExpr(hasType(pointsTo(qualType( - equalsBoundNode(PointerType))))) - .bind(NewExpression))) + hasArgument( + 0, cxxNewExpr(hasType(pointsTo(qualType(hasCanonicalType( + equalsBoundNode(PointerType)))))) + .bind(NewExpression))) .bind(ConstructorCall))), this); } Index: test/clang-tidy/modernize-make-unique.cpp =================================================================== --- test/clang-tidy/modernize-make-unique.cpp +++ test/clang-tidy/modernize-make-unique.cpp @@ -195,3 +195,9 @@ // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: use std::make_unique instead // CHECK-FIXES: auto Spaces = std::make_unique(); } + +void nesting() { + auto Nest = std::unique_ptr>(new std::unique_ptr(new int)); + // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: use std::make_unique instead + // CHECK-FIXES: auto Nest = std::make_unique>(new int); +}