[PATCH] D36016: [clang-tidy] Support initializer-list constructor cases in modernize-make-unique.
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 3 07:50:13 PDT 2017
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
LG with a couple of comments.
================
Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:253
+ // std::make_smart_ptr<S>({});
+ auto NumArgs = NewConstruct->getNumArgs();
+ if (NumArgs <= 0) {
----------------
s/auto/unsigned/, since the use of `auto` here seems to not be in line with http://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable.
================
Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:254
+ auto NumArgs = NewConstruct->getNumArgs();
+ if (NumArgs <= 0) {
+ return;
----------------
The `< 0` case doesn't make sense (it will be clear once you change the `auto` above to the real type).
https://reviews.llvm.org/D36016
More information about the cfe-commits
mailing list