<div dir="ltr"><div><div>Hi,</div><div><br></div><div>You need to take a look at clang-tidy check readability-braces-around-statements.</div><div>It's documentation can be found at <a href="http://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html">http://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html</a>.</div><div><br></div><div>Best regards,</div><div>Marek Kurdej</div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote"><span style="font-size:12.8px">Hi,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><div style="font-size:12.8px"><p>I'd like to know if clang-format could be setup to reduce non-compound_statement into { non-compound_statement; } in iteration_statement.</p><pre style="white-space:pre-wrap"><code>statement
: labeled_statement
| compound_statement
| expression_statement
| selection_statement
| iteration_statement
| jump_statement
;
iteration_statement
: WHILE '(' expression ')' statement
| DO statement WHILE '(' expression ')' ';'
| FOR '(' expression_statement expression_statement ')' statement
| FOR '(' expression_statement expression_statement expression ')' statement
;
</code></pre><p>i.e for construct like if(exp)foo=1; I'd like to get if(exp){foo=1;} Then the beautifier would indent as needed.</p><p>Thanx in advance Cheers, Phi</p><div><span style="font-size:small"> </span><br></div></div></blockquote></div>
</div>