https://bugs.llvm.org/show_bug.cgi?id=44487
Bug ID: 44487
Summary: Commenting out case lines in switch statement. Last
case behaves differently.
Product: clang
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: jzpigtc4...@0box.eu
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
In the midst of a switch statement, clang-format recognizes if a case line is
commented out. But at the end, at the last case, does *not*. At least in
version 8. At least I did not succeed to make such configuration file
(.clang-format) which eliminates this inconsistent behaviour.
$ clang-format -version
clang-format version 8.0.0-3 (tags/RELEASE_800/final)
$ cat gg.c
switch (a) {
case A: blah(1); break;
case B: blah(2); break;
// case C: blah(3); break;
case D: blah(4); break;
}
$ cat g1.c
switch (a) {
case A: blah(1); break;
case B: blah(2); break;
case C: blah(3); break;
// case D: blah(4); break;
}
$ clang-format -style=file gg.c
switch (a) {
case A: blah(1); break;
case B: blah(2); break;
// case C: blah(3); break;
case D: blah(4); break;
}
$ clang-format -style=file g1.c
switch (a) {
case A: blah(1); break;
case B: blah(2); break;
case C:
blah(3);
break;
// case D: blah(4); break;
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs