[llvm-bugs] [Bug 25906] New: Alignment when calling a chain of functions

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 20 20:58:00 PST 2015


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

            Bug ID: 25906
           Summary: Alignment when calling a chain of functions
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jasjuang at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Suppose I have something like this, AAAAAAAAAAAAAAAAAA is a member function of
obj that returns an object, and that object has member function
BBBBBBBBBBBBBBBBBB which also returns an object and so on.

void main()
{
 
obj.AAAAAAAAAAAAAAAAAA(a).BBBBBBBBBBBBBBBBBB(b).CCCCCCCCCCCCCCCCCC(c)->DDDDDDDDDDDDD(d);
}

When using the default google style, it reformats to

void main()
{
  obj.AAAAAAAAAAAAAAAAAA(a)
      .BBBBBBBBBBBBBBBBBB(b)
      .CCCCCCCCCCCCCCCCCC(c)
      ->DDDDDDDDDDDDD(d);
}

Is is possible to add a feature (or perhaps it exist) so that it can be
reformatted to 

void main()
{
  obj.AAAAAAAAAAAAAAAAAA(a).BBBBBBBBBBBBBBBBBB(b).CCCCCCCCCCCCCCCCCC(c)
     ->DDDDDDDDDDDDD(d);
}

or at least to 

void main()
{
  obj.AAAAAAAAAAAAAAAAAA(a)
     .BBBBBBBBBBBBBBBBBB(b)
     .CCCCCCCCCCCCCCCCCC(c)
     ->DDDDDDDDDDDDD(d);
}

Please let me know, thanks!

-- 
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/20151221/bf495b32/attachment.html>


More information about the llvm-bugs mailing list