: Cell);
// Go to the next non-comment and ensure there is a break in front
const auto *NextNonComment = C.Tok->getNextNonComment();
- while (NextNonComment->is(tok::comma))
+ while (NextNonComment && NextNonComment->is(tok::comma))
NextNonComment = NextNonComment->getNextNonComment();
auto j = i;
while (Changes[j].Tok != NextNonComment && j < End)
" [0] = {1, 1},\n"
" [1] { 1, 1, },\n"
" [2] { 1, 1, },\n"
- "};");
+ "};",
+ Style);
+ verifyNoCrash("test arr[] = {\n"
+ "#define FOO(i) {i, i},\n"
+ "SOME_GENERATOR(FOO)\n"
+ "{2, 2}\n"
+ "};",
+ Style);
verifyFormat("return GradForUnaryCwise(g, {\n"
" {{\"sign\"}, \"Sign\", "
" [0] = {1, 1},\n"
" [1] { 1, 1, },\n"
" [2] { 1, 1, },\n"
- "};");
+ "};",
+ Style);
+ verifyNoCrash("test arr[] = {\n"
+ "#define FOO(i) {i, i},\n"
+ "SOME_GENERATOR(FOO)\n"
+ "{2, 2}\n"
+ "};",
+ Style);
verifyFormat("return GradForUnaryCwise(g, {\n"
" {{\"sign\"}, \"Sign\", {\"x\", "