-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed as not planned
Closed as not planned
Copy link
Labels
clang-formatquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
During PR #154580 we noticed that empty records (struct
,union
,class
) get incorrectly merged by clang-format running on default config:
struct foo {};
struct bar {
int i;
};
This happens even with BreakBeforeBraces: Custom
and BraceWrapping.SplitEmptyRecord: true
.
Expected output in both cases is:
struct foo {
};
struct bar {
int i;
};
Behavior is correct if BraceWrapping.AfterStruct: true
:
struct foo
{
};
struct bar
{
int i;
};
Occurs at least since version 12.0.0 and is likely an issue in LineJoiner::tryFitMultipleLinesInOne
or it's callees.
Metadata
Metadata
Assignees
Labels
clang-formatquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!