llvm-project
9512d6d2 - [clang-format] Fix parsing of `operator<() {}` (#75144)

Commit
1 year ago
[clang-format] Fix parsing of `operator<() {}` (#75144) Fixes #74876. During the parsing of `operator<(Foo&) {}`, there was no handling for the operator<, so it called `consumeToken()` again, causing the `AnnotationParser::Scopes` to have one additional left brace each time it tried to parse it, leaving it unbalanced. Because of this, in the following code: ```cpp class Foo { void operator<(Foo&) {} Foo& f; }; ``` The `&` in the reference member, was being interpreted as `TT_BinaryOperator` instead of `TT_PointerOrReference`.
Author
Parents
Loading