-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
Description
clang-format version 21.1.6
description:
int foo(void) {
a = (AA){
.f = ^{
; // a statement added here
},
};
printf("Hello World!\n"); // impacts this line
}
test file used: sample.c
command and output:
> clang-format --version; clang-format sample.c
clang-format version 21.1.6
// this works well
int foo() {
a = (AA){
.f =
^{
},
};
printf("Hello World!\n");
}
// statement in block impacts following line
int foo2(void) {
a = (AA){.f = ^{
; // a statement added
}
,
}
;
printf("Hello World!\n"); // this line has wrong indent
}
// clang-format off still impacts following line
int foo3(void) {
// clang-format off
a = (AA){
.f = ^{
;
},
};
// clang-format on
printf("Hello World!\n"); // this line has wrong indent
}
// disabling func as a whole works
// clang-format off
int foo4(void) {
a = (AA){
.f = ^{
;
},
};
printf("Hello World!\n");
}
// clang-format on