Skip to content

Commit 47c1a56

Browse files
committed
[clang-tidy] Make MatchesAnyListedNameMatcher::NameMatcher public
The same matching mechanism should be used both there and within bugprone-unsafe-functions check.
1 parent c4e05bd commit 47c1a56

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

clang-tools-extra/clang-tidy/utils/Matchers.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,7 @@ class MatchesAnyListedNameMatcher
8585
NameList.begin(), NameList.end(), std::back_inserter(NameMatchers),
8686
[](const llvm::StringRef Name) { return NameMatcher(Name); });
8787
}
88-
bool matches(
89-
const NamedDecl &Node, ast_matchers::internal::ASTMatchFinder *Finder,
90-
ast_matchers::internal::BoundNodesTreeBuilder *Builder) const override {
91-
return llvm::any_of(NameMatchers, [&Node](const NameMatcher &NM) {
92-
return NM.match(Node);
93-
});
94-
}
9588

96-
private:
9789
class NameMatcher {
9890
llvm::Regex Regex;
9991
enum class MatchMode {
@@ -136,6 +128,15 @@ class MatchesAnyListedNameMatcher
136128
}
137129
};
138130

131+
bool matches(
132+
const NamedDecl &Node, ast_matchers::internal::ASTMatchFinder *Finder,
133+
ast_matchers::internal::BoundNodesTreeBuilder *Builder) const override {
134+
return llvm::any_of(NameMatchers, [&Node](const NameMatcher &NM) {
135+
return NM.match(Node);
136+
});
137+
}
138+
139+
private:
139140
std::vector<NameMatcher> NameMatchers;
140141
};
141142

0 commit comments

Comments
 (0)