================ @@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl &Node) const { return Patterns.foundMatch(/*AllowFullyQualified=*/true); } +static std::optional<StringRef> consumePatternBack(StringRef Pattern, + StringRef Target) { + while (!Pattern.empty()) { + auto Index = Pattern.rfind("<*>"); + if (Index == StringRef::npos) { + if (Target.consume_back(Pattern)) + return Target; + return {}; + } + auto Suffix = Pattern.substr(Index + 2); + if (!Target.consume_back(Suffix)) + return {}; + auto BracketCount = 1; + while (BracketCount) { + if (Target.empty()) + return {}; ---------------- 5chmidti wrote:
IMO returning `std::nullopt` is better here. https://github.com/llvm/llvm-project/pull/100349 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits