<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I just encountered this use case with clang-format:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Consider the following function:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">...</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><div class="gmail_default"> void Reset() { // Like Clear() but retain m_initialCommand. Used when an editor is reloaded</div><div class="gmail_default"> m_commands.clear();</div><div class="gmail_default"> }</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">...</div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">and in my clang-format plugin, I have the option:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">"Allow Short Functions on A Single Line" enabled.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">So, after indenting I get this:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><div class="gmail_default"><div class="gmail_default"> void Reset() { // Like Clear() but retain m_initialCommand. Used when an editor is reloaded m_commands.clear(); }</div><div><br></div><div>Which breaks compilation (and thanks to gcc poor error reporting it only took me 30 mins to figure what went wrong :P )</div><div><br></div><div>Thanks,</div></div></div><br></div>-- <br><div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah,<br>Author of codelite, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br></font><div><font face="verdana, sans-serif">CodeLite IDE Blog: <a href="http://codeliteide.blogspot.com/" target="_blank">http://codeliteide.blogspot.com/</a></font></div></div>
</div>