[PATCH] D145030: [clang-tidy] use isConvertingConstructor to simplify code
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("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("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
[PATCH] D145031: [clang-tidy] use isConvertingConstructor to simplify code
thyecust created this revision. thyecust added a reviewer: clang-tools-extra. thyecust added a project: clang-tools-extra. Herald added subscribers: carlosgalvezp, 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: rG LLVM Github Monorepo 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 @@ -97,8 +97,7 @@ } const auto *Ctor = Result.Nodes.getNodeAs("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("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
[PATCH] D145031: [clang-tidy] use isConvertingConstructor to simplify code
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("ctor"); if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 || - Ctor->getMinRequiredArguments() > 1) + 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 @@ -98,7 +98,7 @@ const auto *Ctor = Result.Nodes.getNodeAs("ctor"); if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 || - Ctor->getMinRequiredArguments() > 1) + 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
[PATCH] D145031: [clang-tidy] use isConvertingConstructor to simplify code
thyecust abandoned this revision. thyecust added a comment. this change looks meaningless now CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145031/new/ https://reviews.llvm.org/D145031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits