<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 Add Option to Align References Independently From Pointers"
   href="https://bugs.llvm.org/show_bug.cgi?id=42165">42165</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-format Add Option to Align References Independently From Pointers
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>matthias.schaefer@versasec.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Though I understand that references and pointers to other types are both
technically just types, the usage of references as parameters of functions
feels much different than using pointers because a reference is automatically
created when a variable is passed to a function and a reference is also
dereferenced implicitly and can be used like a local variable inside the
function. In contrast a pointer must be obtained explicitly to pass it into a
function and it also needs to be dereferenced explicitly each time the
referenced object is accessed inside the function.

This is why the general perception of references is that they are not part of
the parameter type but rather a parameter passing convention. Hence I would
like to be able to align references independently of pointers. I propose to add
2 new settings:
- DeriveReferenceAlignment, which should have the same options as
DerivePointerAlignment, the default should be the option specified by
DerivePointerAlignment or, if DerivePointerAlignment is not configured, its
default.
- ReferenceAlignment, which should have the same options as PointerAlignment,
the default should be the option specified by PointerAlignment or, if
PointerAlignment is not configured, its default.</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>