Index: clang-tidy/modernize/MakeSmartPtrCheck.cpp =================================================================== --- clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -111,9 +111,9 @@ if (New->getNumPlacementArgs() != 0) return; - if (Construct) + if (Construct && !Construct->getLocation().isMacroID()) checkConstruct(SM, Construct, Type, New); - else if (Reset) + else if (Reset && !Reset->getExprLoc().isMacroID()) checkReset(SM, Reset, New); } Index: test/clang-tidy/modernize-make-unique.cpp =================================================================== --- test/clang-tidy/modernize-make-unique.cpp +++ test/clang-tidy/modernize-make-unique.cpp @@ -336,3 +336,14 @@ // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: use std::make_unique instead // CHECK-FIXES: *Q = std::make_unique(); } + +#define DEFINE(...) __VA_ARGS__ +template +void g2(std::unique_ptr *t) { + DEFINE(auto p = std::unique_ptr(new Foo); t->reset(new Foo);); +} +void macro() { + std::unique_ptr *t; + g2(t); +} +#undef DEFINE