[llvm-bugs] [Bug 30582] Incorrect alignment in the indentation

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 28 07:08:53 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30582

Daniel Jasper <djasper at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #1 from Daniel Jasper <djasper at google.com> ---
This behavior is intended as you basically have two different "binary"
operators in a set of parenthese: "&&" and ",". Thus, clang-format uses the
extra indentation to highlight that the second line is not just one more
parameter to the surrounding function call.

You can of course avoid that by either pulling out local variables or
surrounding the &&-expression with parentheses.

Again, this is intended. Imagine, you'd have an expression like:

  function(aaaa &&
           bbbb,
           cccc,
           dddd &&
           eeee,
           ffff);

Obviously this is fabricated, but I have seen many cases, where the extra
indentation makes the code significantly more obvious.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161028/094d5165/attachment.html>


More information about the llvm-bugs mailing list