Here is the test file:
#include <stdio.h> int main() { for(;;) if (true) printf("hello"); return 0; }
Expected output when run with --add-braces:
#include <stdio.h> int main() { for(;;) { if (true) { printf("hello"); } } return 0; }
Actual output:
#include <stdio.h> int main() { for(;;) if (true) { printf("hello"); } return 0; }
I hope that I have not misunderstood the expected behavior of the --add-braces flag.
Ticket moved from /p/astyle/bugs/453/