<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55407>55407</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-format: PointerAlignment: Right not working with tab indentation.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ashleypittman
      </td>
    </tr>
</table>

<pre>
    When using PointerAlignment: Right with Tabs then variable names get aligned incorrectly.  This needs a combination of UseTab and PointerAlignment to reproduce, and probably AlignConsecutiveDeclarations as well in order to request the alignment.  It's broken for several values of UseTab, although Never works as expected.

We are also using IndentWidth: 8, without this then UseTab ForIndentation appears to work, at least for first-level indents although UseTab Always is still broken.

Sample input file:
```
struct something_big {
    int value;
};

int main() {
    struct something_big big;
    char *ptr;
    int i;
    return 0;
}
```

Configuration
```
#UseTab: ForIndentation
UseTab: Always
PointerAlignment: Right
AlignConsecutiveDeclarations: true
IndentWidth: 8
```

Observed output, note the incorrect spacing before *ptr.
```
struct something_big {
        int value;
};

int main() {
        struct something_big big;
        char            *ptr;
        int                  i;

        return 0;
}
```

When running with PointerAlignment: Middle we see the output is correct, however this does not match our existing coding style.
```
struct something_big {
  int value;
};

int main() {
  struct something_big big;
  char *               ptr;
  int                  i;

  return 0;
}
```

Verified on `clang-format version 14.0.0 (Fedora 14.0.0-1.fc36)` (fedora 36) and others.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVUtz4zYM_jXyBRONLMWxfdDBu5nM7KGPabfNsUOJkMQuTaokZdf_vgCpxFWTdF8eWQ8CBD58eLCx8lI_Dmhg8sr08LNVJqA7aNWbI5qQVQf4RfVDgLMKA3wUjYfA6ifhlGg0ghFH9NBjAMGbUIIyrXUO26AvOcDHQXkwiNKDgNYeG2VEUNaA7eA3j2QRhJEvHEOw4HB0Vk4tZuX7qESfDTm9Q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