[PATCH] D145031: [clang-tidy] use isConvertingConstructor to simplify code

thyecust via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 00:49:06 PST 2023


thyecust updated this revision to Diff 501407.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145031/new/

https://reviews.llvm.org/D145031

Files:
  clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp


Index: clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
+++ clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
@@ -98,7 +98,7 @@
 
   const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor");
   if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 ||
-      Ctor->getMinRequiredArguments() > 1)
+      Ctor->isConvertingConstructor(true))
     return;
 
   bool TakesInitializerList = isStdInitializerList(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145031.501407.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230301/f6fef9c4/attachment.bin>


More information about the cfe-commits mailing list