[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

Jack Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 00:15:13 PDT 2022


jackhong12 updated this revision to Diff 438921.
jackhong12 marked an inline comment as done.
jackhong12 added a comment.

I have added a variable for `MatchingLBrace->getPreviousNonComment()`.

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;


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

https://reviews.llvm.org/D127873

Files:
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/TokenAnnotatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127873.438921.patch
Type: text/x-patch
Size: 5052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220622/dee644df/attachment.bin>


More information about the cfe-commits mailing list