<div dir="ltr">Not sure who's doing most of the work on clang-format these days - Sam, maybe you know?<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 2:07 AM Jakob van Bethlehem via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all,<div><br></div><div>Recently we introduced clang-format into our company, for formatting c++-code. After some fine-tuning of the settings, we're extremely happy with it. Today I came across a bit of code that uses a function try-block - not a very-often use feature of C++, but sometimes usefuly, however, I don't really like what clang-format is doing, and I'm having trouble figuring out how to tell clang-format what to do.</div><div><br></div><div>So, here is the header of the function that has the problem:</div><div><div><br></div><div>HlPropertiesParser::HlPropertiesParserError HlPropertiesParser::readPropertiesDataFromFile(</div><div> const std::wstring& filename,</div><div> std::vector<HullLinePropertyRule>& hlPropertyRules,</div><div> std::wstring& errorMsg)</div><div>try</div><div>{</div></div><div> /// code</div><div><br></div><div>Of course down below will be the closing brace of the function, and a number of catch-clauses. When I now run clang-format on it, it will move the 'try' after the closing bracket like so:</div><div><br></div><div><div>HlPropertiesParser::HlPropertiesParserError HlPropertiesParser::readPropertiesDataFromFile(</div><div> const std::wstring& filename,</div><div> std::vector<HullLinePropertyRule>& hlPropertyRules,</div><div> std::wstring& errorMsg) try</div><div>{</div></div><div><br></div><div>It looks as if clang-format considers this like a const- or noexcept specifier. However, I would really like to tell clang-format to put the 'try' on the next line, preferably even always at the start of the line. Is there a style option that will let be achieve this?</div><div><br></div><div>Sincerely,</div><div>Jakob van Bethlehem</div><div><br></div></div></div></div>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div></div>