================
@@ -2283,6 +2283,37 @@ using HasOpNameMatcher =
HasOpNameMatcher hasAnyOperatorNameFunc(ArrayRef<const StringRef *> NameRefs);
+/// Matches nodes of type T (CompoundStmt or StmtExpr) that contain a sequence
+/// of consecutive substatements matching the provided matchers in order.
+///
+/// See \c hasAdjSubstatements() in ASTMatchers.h for details.
+template <typename T, typename ArgT = std::vector<Matcher<Stmt>>>
+class HasAdjSubstatementsMatcher : public MatcherInterface<T> {
+ static_assert(std::is_same<T, CompoundStmt>::value ||
+ std::is_same<T, StmtExpr>::value,
+ "Matcher only supports `CompoundStmt` and `StmtExpr`");
----------------
denzor200 wrote:
This matcher is already polymorphic, by that logic. I built it using
`hasAnyOperatorName` :)
<img width="603" height="119" alt="image"
src="https://github.com/user-attachments/assets/57e34a7d-51fe-494e-91d8-b99f11fef2dd"
/>
https://github.com/llvm/llvm-project/pull/169965
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits