[llvm-bugs] [Bug 25489] New: AlignConsecutiveAssignments misbehaves for functions returning references

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 11 08:08:39 PST 2015


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

            Bug ID: 25489
           Summary: AlignConsecutiveAssignments misbehaves for functions
                    returning references
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Given functions returning references:

static int a_v = 3;
static int a2_v = 4;

int& a() { return a_v; }
int& a2() { return b_v; }

one can assign through a function call as follows: 

a() = 4;
a2() = 5;


clang-format doesn't recognizes that the assignment operator=(..) is being used
here, and thus doesn't align these assignments.

They should probably be aligned to: 

a()  = 4;
a2() = 5;

-- 
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/20151111/2d7844ea/attachment.html>


More information about the llvm-bugs mailing list