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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Ability to configure breaking after short 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>
          rmarker
      </td>
    </tr>
</table>

<pre>
    Currently, when ` AlwaysBreakAfterReturnType` is `None`, line breaks are prevented after 'short' return types.

>From `ContinuationIndenter.cpp`
```
// Don't break after very short return types (e.g. "void") as that is often
// unexpected.
if (Current.is(TT_FunctionDeclarationName) && State.Column < 6) {
  if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None)
    return false;
}
```

Note, that 'short' here isn't the length of the type itself, but the column where the type finishes.
So, the indentation can change the behaviour.

While the comment says that breaking would be unexpected, this behaviour takes precedence over any of the penalty options for configuring where to place line breaks. It is fairly specific behaviour and can also be unexpected as it avoids breaking after the return type seemly ignoring the penalty configuration.

It would be helpful if there was a way that this could be configured.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VM2OszgQfBpzaQ0Ck4Rw4JBJFGkuc_hmpD1-MqYB7xgb2U2yvP3KJplJ9keKiBDdVV3VZQvvVW8Qa7Z9ZdtTImYarKvdKNwXuqSx7VIfZ-fQkF4YP8J1QANsl8FBX8XiXx2Kr0NH6H4hzc58LhOGr8qHondrwlvo08ogNKHag3AIk8MLGsIWROgGxks_WEeMl-AiFNAyoU9ZdmLZYX2enR0D7tEaUmYWpKx5M23AcamcpsC1lu-y22995WfGz3CyhvGS1jFuvBd0C0TmJ1pgfI9pnwLj_GJVyzhnvALhgQZBQZ7tCM0T_GzwrwklYXsbWnUB5mZfqjzj-8_P3-fZyDD4CaUWLmp4FyMGeMZ3jO_ggwRherR6Hg2w4gi7-LF8XWEBVuAPWjS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