[PATCH] D36264: [clang-tidy] Ignore macros in make-unique check.

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 03:44:47 PDT 2017


alexfh accepted this revision.
alexfh added a comment.

LG with a couple of nits.



================
Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:54
+          Options.get("MakeSmartPtrFunction", MakeSmartPtrFunctionName)),
+      IgnoreMacros(Options.get("IgnoreMacros", true)) {}
 
----------------
Let's go with `getLocalOrGlobal` to be able to set the option for all checks at once. Other checks having this option do this already.


================
Comment at: test/clang-tidy/modernize-make-unique-macros.cpp:14
+      auto p = std::unique_ptr<Foo>(new Foo);
+      // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: use std::make_unique instead
+      t->reset(new Foo);
----------------
Please add CHECK-FIXES to verify that the code remains intact (both macro definition and expansion).


https://reviews.llvm.org/D36264





More information about the cfe-commits mailing list