================
@@ -29,7 +29,75 @@ namespace clang::tidy::bugprone {
using matchers::hasUnevaluatedContext;
-namespace {
+static auto getNameMatcher(llvm::ArrayRef<StringRef> InvalidationFunctions) {
+ return anyOf(hasAnyName("::std::move", "::std::forward"),
+ matchers::matchesAnyListedName(InvalidationFunctions));
+}
+
+static StatementMatcher
+makeReinitMatcher(const ValueDecl *MovedVariable,
+ llvm::ArrayRef<StringRef> InvalidationFunctions) {
+ const auto DeclRefMatcher =
+ declRefExpr(hasDeclaration(equalsNode(MovedVariable))).bind("declref");
+
+ static const auto StandardContainerTypeMatcher =
----------------
vbvictor wrote:
Does it matter here to add `static`? AFAIK we call `makeReinitMatcher` only
once and I'm not sure how matchers will behave if multiple matchers are
constructed with same `static` submathers.
https://github.com/llvm/llvm-project/pull/172219
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits