This revision was automatically updated to reflect the committed changes.
curdeius marked an inline comment as done.
Closed by commit rGd81f003ce141: [clang-format] Fix formatting of struct-like
records followed by variable… (authored by curdeius).
Changed prior to commit:
curdeius marked 3 inline comments as done.
curdeius added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735
// We don't merge short records.
-FormatToken *RecordTok = Line.First;
-// Skip record modifiers.
-while
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735
// We don't merge short records.
-FormatToken *RecordTok = Line.First;
-// Skip record modifiers.
-while (RecordTok->Next &&
-
curdeius added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735
// We don't merge short records.
-FormatToken *RecordTok = Line.First;
-// Skip record modifiers.
-while (RecordTok->Next &&
-
curdeius added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:718
if (Line.Last->is(tok::l_brace)) {
FormatToken *Tok = I[1]->First;
@MyDeveloperDay, probably we'll need to check `LastNonComment` similarly to
what I did
curdeius added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:470
+ShouldMerge = Style.AllowShortEnumsOnASingleLine;
+ } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace)) {
+// NOTE: We use AfterClass (whereas
HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:470
+ShouldMerge = Style.AllowShortEnumsOnASingleLine;
+ } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace))
MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.
This revision is now accepted and ready to land.
LGTM, I really like the approach of us annotating more like this, it makes the
token much easier to reason about when there is ambiguity. nice one!
Comment
curdeius updated this revision to Diff 408629.
curdeius added a comment.
Remove unused.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119785/new/
https://reviews.llvm.org/D119785
Files:
clang/lib/Format/FormatToken.h
curdeius created this revision.
curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan.
curdeius requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes https://github.com/llvm/llvm-project/issues/24781.
Fixes
10 matches
Mail list logo