[PATCH] D37066: [clang-tidy] A follow-up fix of braced-init-list constructors in make-unique check.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 02:00:26 PDT 2017

hokein added inline comments.

Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:279
     if (const auto *CE = New->getConstructExpr()) {
-      for (const auto *Arg : CE->arguments()) {
-        if (llvm::isa<CXXStdInitializerListExpr>(Arg)) {
-          return false;
-        }
+      if (!ast_matchers::match(findAll(cxxStdInitializerListExpr()), *CE,
+                               CE->getConstructor()->getASTContext())
alexfh wrote:
> I wonder whether this exception can be too broad, e.g. if the initializer list is a part of a more deeply nested expression inside the CXXConstructExpr?
Done. I overthought the cases here. The case we need to ignore is the implicit conversion from std::initailizer_list.


More information about the cfe-commits mailing list