Open yous opened 6 months ago
Seems to be regressed by c83d64f17a6e38f39fde611f06479e6f2a62b70f
@llvm/issue-subscribers-clang-format
Author: Chayoung You (yous)
Actually, it's a bug unrelated to c83d64f17a6e, which just exposed the bug:
$ clang-format -version
clang-format version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
$ cat foo.c
int main() {
EMPTY_MACRO
(void)memcpy(obj->dest, obj->src, 1);
return 0;
}
$ clang-format -style='{Macros: [EMPTY_MACRO=;]}' -debug foo.c
...
Assertion failed: (Tok == Line.Last), function printDebugInfo, file TokenAnnotator.cpp, line 5615.
...
$
cc @r4nt
clang-format 18.1.8 and 19.1.0 still have this issue.
With
EMPTY_MACRO=;
inMacros
, clang-format 18.1.4 adds spaces around->
.clang-format 17.0.6 doesn't have this issue: