I have a problem with indenting in C++.
The following code gets indented incorrectly:
for (int i=0;
i<1;
++i) {
int x = 0;
for (int j=0; j<1; ++j) {
x=i*j;
}
}
There is an unindent after the int x=0; line, which should not happen.
These versions work:
for (int i=0;i<1;++i) {
int x = 0;
for (int j=0; j<1; ++j) {
x=i*j;
}
}
for (int i=0;
i<1;
++i)
{
int x = 0;
for (int j=0; j<1; ++j) {
x=i*j;
}
}
for (int i=0;
i<1;
++i) {int x = 0;
for (int j=0; j<1; ++j) {
x=i*j;
}
}
This is simplified example to show the problem. I manage a large code base where this happens a lot.
Is this a known bug or feature? Could I have some setting wrong to mess this up? I am using version 3.2.2. build 3211.