<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang-Format: Option AlignConsecutiveAssignments not working with Statement-Expressions"
   href="https://bugs.llvm.org/show_bug.cgi?id=34151">34151</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-Format: Option AlignConsecutiveAssignments not working with Statement-Expressions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Formatter
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sebastiankeller@fastmail.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18963" name="attach_18963" title="clang-format configuration file">attachment 18963</a> <a href="attachment.cgi?id=18963&action=edit" title="clang-format configuration file">[details]</a></span>
clang-format configuration file

Hello,

it seems like the open `AlignConsecutiveAssignments` in combination with
statement expressions is not working correctly (anymore).

All equal signs are placed on the first lines equal sign, if possible.

This leads to some weird formatting if the name is too short or very long.




```
#include <stdio.h>

int test() {
  // If the name (a) is short the formatting is off
  int a = ({
    int b= 1;
    int c= b + 1;
    int d= c + 1;
    d
  });

  /**
   * Is it possible to have it that way?
   */
  //  int a = ({
  //    int b = 1;
  //    int c = b + 1;
  //    int d = c + 1;
  //    d
  //  });

  // ------------------------------

  // It seems not so bad here, but if the longerName gets event longer it
  // becomes worse
  int longerName = ({
    int bb       = 1;
    int cccc     = b + 1;
    int dd       = c + 1;
    d;
  });

  int somethingRidiculousLongProbablyWithBadNamingAndATpyo = ({
    int bb                                                 = 1;
    int cccc                                               = b + 1;
    int dd                                                 = c + 1;
    d;
  });

  /**
   * I think this would be the right formatting.
   */
  //  int somethingRidiculousLongProbablyWithBadNamingAndATpyo = ({
  //    int bb   = 1;
  //    int cccc = b + 1;
  //    int dd   = c + 1;
  //    d;
  //  });

  return a;
}
```

The .clang-format file is as following
```
---
Language:         Cpp
BasedOnStyle:  Google
AlignConsecutiveAssignments: true
...
```

Thank you very much!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>