<div dir="ltr">I significantly prefer the new formatting FWIW.<div><br></div><div>I don't like continuations without indent at all. I'm willing to concede the necessity of them for functions, but for variables it feels quite bad to me.</div>
<div><br></div><div>An example of where the old behavior was very confusing for me, let's take the following code:</div><div><br></div><div>static llvm::cl::opt<whatever> MyLongOptionName(args, more_args, "yadda yadda");</div>
<div><br></div><div>If we end up (due to the specific balance of string length above) breaking before "MyLongOptionName" we get no indent. But if we break after the "(" we get 4 spaces of indent. This is even weirder if your variable doesn't use a "type name(arg, arg);" style of initialization, but instead is "type name = a + b;" as now 'name' would get no indent but 'a' as the start of the second line would get indent. I understand the C++ grammar rules which lead to that scenario, but find it really awkward when reading code.</div>
<div><br></div><div>With the new logic, there is one rule for all indentation when breaking a variable declaration across multiple lines: 4 spaces of indent. There is also one rule for indentation when breaking after the return type of a function: no indent.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 9, 2014 at 1:47 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, this is intended and I actually don't think that it is such a big difference. Multiline variable declaration that are broken after the type are actually reasonably rare.<div>
<br></div><div>Happy, to take a vote on this though..</div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 9, 2014 at 10:42 AM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 09/07/2014 09:50, Daniel Jasper wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: djasper<br>
Date: Wed Jul  9 02:50:33 2014<br>
New Revision: 212591<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=212591&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=212591&view=rev</a><br>
Log:<br>
clang-format: Revamp function declaration/definition indentation.<br>
<br>
Key changes:<br>
- Correctly (well ...) distinguish function declarations and variable<br>
   declarations with ()-initialization.<br>
- Don't indent when breaking function declarations/definitions after the<br>
   return type.<br>
- Indent variable declarations and typedefs when breaking after the<br>
   type.<br>
<br>
This fixes <a href="http://llvm.org/PR17999" target="_blank">llvm.org/PR17999</a>.<br>
</blockquote>
<br></div>
I think this commit changed the formatting of global command line declarations in LLVM:<br>
<br>
static cl::opt<bool><br>
DetectScopsWithoutLoops("<u></u>polly-detect-scops")<br>
<br>
became:<br>
<br>
static cl::opt<bool><br>
    DetectScopsWithoutLoops("<u></u>polly-detect-scops")<br>
<br>
and<br>
<br>
static cl::opt<std::string><br>
OnlyFunction("polly-only-func"<u></u>)..<br>
<br>
became<br>
<br>
<br>
static cl::opt<std::string> OnlyFunction(<br>
    "polly-only-func")<br>
<br>
I personally was very happy with the previous formatting. Was this change intended?<br>
<br>
As this introduces a large difference compared to clang-format-3.4, I would prefer to keep the existing style.<span><font color="#888888"><br>
<br>
Tobias<br>
</font></span></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>