1 Commits

Author SHA1 Message Date
Colby Mchenry 242862182b fix(cpp): a comparison or shift in a call's arguments opens no template, and a declared type's template arguments pair their brackets (#2553)
Splitting a call's arguments counted every `<` as a template's, so protobuf's
`p->Emit({{"declare", has_bit_word_index < 0 ? … : ""}, …}, "…")` and
`WriteVarint(num << 3, s)` read as one argument and took the wrong overloads.
A `<` now opens template arguments only right after a name and when a `>`
closes it before the bracket around it does, and the splitter closes the list
at exactly that `>`. A declared type's template arguments now pair their
brackets and may be empty, so `const std::vector<A*>& a, std::vector<B>& b`
and fmt's `parse_context<>& ctx` are read. A line that ends a declaration
begun above, like `std::unique_ptr<Blob>>>& reqs`, still declares the
receiver there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 06:32:23 +00:00