llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang-format crashes with AlignArrayOfStructures

Open derzhavin3016 opened this issue 1 year ago • 1 comments

version: 19.0.0git (a6a9215b93bcbf901cd11d2dd02cce1a245d3ffe) OS: Ubuntu 22.04.3

.clang-format

AlignArrayOfStructures: Left

MRE:

struct test {
  int a, b;
};

#define SOME_GENERATOR(macro) macro(0) macro(1)

static const test arr[] = {
#define FOO(i) {i, i},
SOME_GENERATOR(FOO)
{2, 2}
}; 

Moving line with #define FOO out of initializer resolves this issue

derzhavin3016 avatar Mar 21 '24 11:03 derzhavin3016