diff options
3 files changed, 2 insertions, 18 deletions
diff --git a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp index 89b8b0398d5..4954fe30c02 100644 --- a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp @@ -26,7 +26,7 @@ void StaticObjectExceptionCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( varDecl(anyOf(hasThreadStorageDuration(), hasStaticStorageDuration()), hasInitializer(cxxConstructExpr(hasDeclaration( - cxxConstructorDecl(unless(matchers::isNoThrow())) + cxxConstructorDecl(unless(isNoThrow())) .bind("ctor"))))) .bind("var"), this); diff --git a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp index 3cfcdbf7702..f569789d425 100644 --- a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp @@ -23,7 +23,7 @@ void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( cxxThrowExpr( has(cxxConstructExpr(hasDeclaration(cxxConstructorDecl( - isCopyConstructor(), unless(matchers::isNoThrow())))) + isCopyConstructor(), unless(isNoThrow())))) .bind("expr"))), this); } diff --git a/clang-tools-extra/clang-tidy/utils/Matchers.h b/clang-tools-extra/clang-tidy/utils/Matchers.h index 0ab5ec712e4..834c06b2861 100644 --- a/clang-tools-extra/clang-tidy/utils/Matchers.h +++ b/clang-tools-extra/clang-tidy/utils/Matchers.h @@ -23,22 +23,6 @@ AST_MATCHER(QualType, isExpensiveToCopy) { return IsExpensive && *IsExpensive; } -AST_MATCHER(FunctionDecl, isNoThrow) { - const auto *FnTy = Node.getType()->getAs<FunctionProtoType>(); - - // If the function does not have a prototype, then it is assumed to be a - // throwing function (as it would if the function did not have any exception - // specification). - if (!FnTy) - return false; - - // Assume the best for any unresolved exception specification. - if (isUnresolvedExceptionSpec(FnTy->getExceptionSpecType())) - return true; - - return FnTy->isNothrow(Node.getASTContext()); -} - } // namespace matchers } // namespace tidy } // namespace clang |