thyecust created this revision.
thyecust added a reviewer: clang-tools-extra.
thyecust added a project: clang-tools-extra.
Herald added subscribers: carlosgalvezp, mgehre, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
thyecust requested review of this revision.
Herald added a subscriber: cfe-commits.

isConvertingConstructor() is a better API.

https://google.github.io/styleguide/cppguide.html#Implicit_Conversions:

> constructors that are callable with a single argument, must be marked 
> explicit in the class definition.




Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D145030

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
@@ -97,8 +97,7 @@
   }
 
   const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor");
-  if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 ||
-      Ctor->getMinRequiredArguments() > 1)
+  if (Ctor->isOutOfLine() || Ctor->isConvertingConstructor(true))
     return;
 
   bool TakesInitializerList = isStdInitializerList(


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
@@ -97,8 +97,7 @@
   }
 
   const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor");
-  if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 ||
-      Ctor->getMinRequiredArguments() > 1)
+  if (Ctor->isOutOfLine() || Ctor->isConvertingConstructor(true))
     return;
 
   bool TakesInitializerList = isStdInitializerList(
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to