<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63451>63451</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] AlignConsecutiveDeclarations restarts on function pointers
</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>
The `AlignConsecutiveDeclarations` does not handle function pointer declarations properly. The alignment stops when a function pointer is reached, and starts over with a new alignment.
Example:
```
void foo(
unsigned long a,
void *b,
size_t c,
long long int d,
void (*bar)( void ),
bool e,
void *f
)
{
return;
}
```
Output with `clang-format -style="{BasedOnStyle: llvm, BinPackParameters: false, AlignConsecutiveDeclarations: {Enabled: true}}"`:
```
void foo(unsigned long a,
void *b,
size_t c,
long long int d,
void (*bar)(void),
bool e,
void *f) {
return;
}
```
Expected output:
```
void foo(unsigned long a,
void *b,
size_t c,
long long int d,
void (*bar)(void),
bool e,
void *f) {
return;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE9z2y4Q_TTosmMPRn8sHXSw4_iazPx-9w4SK4kWgwaQk_TTd8ByYzdxpmm748GChx6r99jlzsleI9Yk35J8l_DJD8bWPQpuMWmMeKn_HxBIQTdK9vrOaIft5OURd9gqbrmXRjtSUBAGHWjjYeBaKIRu0m0AYTRSe7QgLl6A0ZoRrXpZQqDngfuA2oPzZnTwNKAG_pZCOrDI2wEFYXfAtQDnufUOzBEtPEk_AAeNT6-ES0J3hG5O4_0zP4wKSTrPSUHnX5wejRTQGUNYeVoAmHSUR4AyugdO2N2MxL3nIGzTvELg5Hf84s9ge4FEljhI7UFcIJEvHMw2DbeEVYSV58XqYl9jjPp5LuCvDBcZdfM3smp-WG_nrRb9ZDVJt2dg964cp_Fh8uPkT9qSgraK637RGXvgHhbOvwQ5d4Qxst5uuUPxoP87LW5AqeMh-LSV-pG33x655Qf0aF0AO65cSB8-vFfpBsh6e695o1CEmbcThoTX8cyC_oaXNz08xyzzlYdz3LZyjpuOvmdoWLu2c46Tq3g7tY6wCv7QwfvnEVuPAky08p8pduP2_7Vy7x7yOSlvKXlVHleKfk7SRNSpqNKKJ1ivinKdFTRlq2So6bpiAlddkVWUlWVWtIUQJV9RbDPMsUxkzShLacHYqszLbLUsKLYVLZqcrcuK5h3JKB64VMtQPUtj-0Q6N2FdpFm-ShRvULnYrBkLjS6CoRTyXWLr8M6imXpHMqqk8-6VxUuvYpe_rGCS7z6sP7B4brD6TTd2yWRVPXg_hjolbE_Yvpd-mJplaw6E7U_1H_8WozVfsfWE7WPGjrB9_KIfAQAA___EsNi1">