owenpan added a comment.

In D127873#3600978 <https://reviews.llvm.org/D127873#3600978>, @jackhong12 
wrote:

> Thanks. I am not sure which modification will be better, the patch I 
> submitted or the following code.
>
>   FormatToken *BeforeLBraceToken = nullptr;
>   if (MatchingLBrace)
>     BeforeLBraceToken = MatchingLBrace->getPreviousNonComment();
>   
>   if (BeforeLBraceToken && BeforeLBraceToken->is(TT_TemplateCloser))
>     return TT_BinaryOperator;

How about the following?

  if (!MatchingLBrace)
    return TT_PointerOrReference;
  const FormatToken *BeforeLBrace = MatchingLBrace->getPreviousNonComment();
  if (!BeforeLBrace || BeforeLBrace->isNot(TT_TemplateCloser))
    return TT_PointerOrReference;
  return TT_BinaryOperator;


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127873/new/

https://reviews.llvm.org/D127873

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to