Clang-Format incorrectly adds a space between a shift operators >> in a for loop

Viewed 55

The code snippets:

for (i = 0; i < j; ++i, k = k >> 1) {
printf();
}

will be turned into

for (i = 0; i<j; ++i, k = k > > 1) {
printf();
}

By my experiments, (i<j;k=k>>1); will be turned into (i<j; k = k> > 1);

which is incorrect, the shift operator should not be separated.

Is this a known issue? I am using clang-format-10.

0 Answers
Related