[llvm-bugs] [Bug 27608] New: clang-format should prefer not to break in the middle of a binary operator expression

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 2 14:23:53 PDT 2016


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

            Bug ID: 27608
           Summary: clang-format should prefer not to break in the middle
                    of a binary operator expression
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dcheng at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Original formatting:
int main() {
  x.ExcessivelyLongFunctionName(
      ReallyLongFunctionCallHere() == kSomeExceedinglyLongConstant);
}

clang-format with chromium style:
int main() {
  x.ExcessivelyLongFunctionName(ReallyLongFunctionCallHere() ==
                                kSomeExceedinglyLongConstant);
}

A bit surprising, since clang-format could have just broken after the (. In
fact, if there's more than one argument, clang-format will prefer to keep the
binary operator expression together.

-- 
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/20160502/47bfc5e8/attachment.html>


More information about the llvm-bugs mailing list