<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63452>63452</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Reference Alignment RAS_Right broken without PAS_Right
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gedare
</td>
</tr>
</table>
<pre>
When `ReferenceAlignment` is `Right` but `PointerAlignment` is `Left` or `Middle`, the alignment of references is broken when the width of the space after the reference is shorter than the width of the space after the pointer.
Example:
```
double *a;
int &b;
```
Output with: `clang-format -style="{BasedOnStyle: llvm, AlignConsecutiveDeclarations: {Enabled: true}, ReferenceAlignment: Right, PointerAlignment: Left}"`:
```
double* a;
int & b;
```
Expected Output:
```
double* a;
int &b;
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU09v4y4Q_TT4ghJhnOD24INTN6ffT63awx5XYMY2uwQsGDftt1-Bt-lq2_2jlSKix8xjxu_NyBjN6AAasj-QfVfIBScfmhG0DFAor1-aTxM4SgR7gAECuB5aa0Z3AodEMGpijplxylAtmPC9Nw4hfJD5HwwZ-ZDQ_0ZrC0Qwwm8oTkDlK4P6gYbXijGRVfBfwdFzaielno3GKaUlEGfZA5UDQsj4Qk3MOPmwBuRfUOe19y1hHWHtet4-y9NsgVTfcep4_WWo_aIsUMJbSarDemccUsKFulz8xFnPuwXnBenZ4ESqNknSW-nGzeDDSSLdRHxJZTvCOakPBxlB37nH9bKl1j6dknJZ5xvvIvQLmifooLcySDTexfxsfbh1UlnQCWFYgNRdIn7gadXS1U1-Q9_ZWLU0G1jnhgT7vSCEt_SdIJTSP2hy-zxDj6DpKs4_1PhlgUI3lb6urmUBTSmu6p1gtaiLqSlVpXmvZVmXJWit6v1uUL1UYigF38mqMA1nvGKC8_KaCVZvoRrKgZdK1ABXA-_JjsFJGrtNpmx9GAsT4wKNqHZ7XlipwMa8ZZw7ONMcTCLuuyI0ibNRyxjJjlkTMb69ggZtXs8fB4Psuzfv6MUf-tA-fs7uXbbF4OQXpPevgWIJtpkQ5zQYhB8JP44Gp0Vte38i_LiOVP7bzMF_gR4JP-ZuI-HH_DXfAgAA__8rvUpN">