-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #75686: add iter_swap and iter_move to the matched name #76117
Fix #75686: add iter_swap and iter_move to the matched name #76117
Conversation
@llvm/pr-subscribers-clang-tidy Author: None (Da-Viper) ChangesFixes #75686 Full diff: https://github.com/llvm/llvm-project/pull/76117.diff 1 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
index 90bf523ffb00b6..18cd7150185a20 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
@@ -58,14 +58,15 @@ void ExceptionEscapeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
- functionDecl(isDefinition(),
- anyOf(isNoThrow(),
- allOf(anyOf(cxxDestructorDecl(),
- cxxConstructorDecl(isMoveConstructor()),
- cxxMethodDecl(isMoveAssignmentOperator()),
- isMain(), hasName("swap")),
- unless(isExplicitThrow())),
- isEnabled(FunctionsThatShouldNotThrow)))
+ functionDecl(
+ isDefinition(),
+ anyOf(isNoThrow(),
+ allOf(anyOf(cxxDestructorDecl(),
+ cxxConstructorDecl(isMoveConstructor()),
+ cxxMethodDecl(isMoveAssignmentOperator()), isMain(),
+ hasAnyName("swap", "iter_swap", "iter_move")),
+ unless(isExplicitThrow())),
+ isEnabled(FunctionsThatShouldNotThrow)))
.bind("thrower"),
this);
}
|
Should Release Notes be updated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tests, documentation, release notes.
…ne-exception-escape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Looks fine even in current stage.
clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
Outdated
Show resolved
Hide resolved
…e at least one parameter
…#76117) Added support for iter_swap, iter_move in bugprone-exception-escape and performance-noexcept-swap checks. Fixes llvm#75686
Fixes #75686