<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108434>108434</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format changed output for template arguments in trailing return types
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilya-biryukov
</td>
</tr>
</table>
<pre>
After 438ad9f2bf25575c474313de4ad85a5da6f69e4c (found by bisecting), clang-format started producing a slightly different formatting in some cases with template arguments in trailing return types.
The new formatting does not necessarily look bad, but I wanted to understand if the new formatting is expected or not. I am not an expert in the intricacies of the various setting that clang-format has, so asking experts.
@owenca, could you let us know if you feel this is a regression or not?
cc @kadircet
All examples are formatted `clang-format -style=google`
Input:
```cpp
template <typename F, typename... Args>
requires internal::future::decayed_produces_co<F, Args...>
explicit Future(F&&, Args&&...) -> Future<
internal::coroutine_result_type<std::decay_t<F>, std::decay_t<Args>...>>;
```
Expected (aka before)
```cpp
template <typename F, typename... Args>
requires internal::future::decayed_produces_co<F, Args...>
explicit Future(F&&, Args&&...) -> Future<internal::coroutine_result_type<
std::decay_t<F>, std::decay_t<Args>...>>;
```
Actual (aka after)
```cpp
template <typename F, typename... Args>
requires internal::future::decayed_produces_co<F, Args...>
explicit Future(F&&, Args&&...) -> Future<
internal::coroutine_result_type<std::decay_t<F>, std::decay_t<Args>...>>;
```
<hr>
And here's another more extreme example.
Expected (before):
```cpp
struct Foo {
template <typename Adaptor>
auto With(Adaptor&& adaptor) & -> status_internal::PurePolicy<
Adaptor, StatusBuilder&> {}
};
```
Actual (after):
```cpp
struct Foo {
template <typename Adaptor>
auto With(Adaptor&& adaptor) & -> status_internal::PurePolicy<
Adaptor, StatusBuilder&> {}
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVkFv4zYT_TX0ZRBBpiRbPviQdWJgbwt8H9BjMCJHEhuaVMlh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