================
@@ -3817,7 +3817,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
         do {
           Tok = Tok->Next;
         } while (Tok && Tok->isNot(TT_OverloadedOperatorLParen));
-        if (!Tok)
+        if (!Tok || !Tok->Next)
----------------
owenca wrote:

```suggestion
        if (!Tok || !Tok->MatchingParen)
```
Otherwise, it would still crash if the unmatched `l_paren` is not the last 
token on the line, e.g.:
```
struct Foo {
  operator foo(bar
};

https://github.com/llvm/llvm-project/pull/82349
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to