Issue 114408
Summary [clang-format] bug in c formatting when "switch" appears as a token
Labels clang-format
Assignees
Reporter mtfurlan
    This is a c file that is correctly formatted according to clang-format 18, but not according  to clang-format 19
`clang-format --dry-run --Werror --style="{BasedOnStyle: llvm, BreakBeforeBraces: Linux}" test.c`
```
FOOBAR(switch); // if we use a word that isn't "switch" everything is fine
// if we do use "switch", the "BreakBeforeBraces: Linux" isn't respected and it
// tries to do "void foo(void) {"

void foo(void)
{ 
  int i = 5;
  printf("foo: %d\n", i);
}
```
I bisected it to `236b3e1aad45e2bab8ede0da6397b7b01f9cc9d8 [clang-format] Handle Java switch expressions (#91112)`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to