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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 09:20:30 PDT 2017

alexfh 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())
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?


More information about the cfe-commits mailing list