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

    <tr>
        <th>Summary</th>
        <td>
            Regression Clang-format 16: AllowShortFunctionsOnASingleLine: Inline
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Found on our codebase comparing clang-format 13 with 16.
Relevant configuration:
AllowShortFunctionsOnASingleLine: Inline

Formatting in 13:
````
namespace NS::Inner
{
 auto function() -> std::unique_ptr<IClass> { return factory<Class, IClass>(); }
}
````

Formatting in 16:
````
namespace NS::Inner
{
   auto function() -> std::unique_ptr<IClass>
   {
 return factory<Class, IClass>();
   }
}
````

I suspect there was a change on what was considered to count for this value.
Documentation of both 13 and 16 state: `Only merge functions defined inside a class`, however, behavior of 13 seems to also merge free functions while this is no longer the case in 16.

For rolling out the upgrade of clang-format, minimal changes to formatting are preferred, such that we can roll this out without merge conflicts and do the changes to the options in a later wave one-by-one. I understand this change and it makes sense, though, having an option to ensure the old behavior will make our upgrades go more smooth.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVNGO6jYQ_RrzMgIFBwI85IGFIlFVvdJdqa-V40wSt44n9dig_fvKDnfZVq207ZUQcTLjOeeMj0cxm94h1mL7IrbnhYphIF__-MtxQrdoqH2rLxRdC-SAogdNLTaKETSNk_LG9aCtcv2yIz-qAOsS7iYMsK5WojiL4vgVLd6UC6DJdaaPXgVDTpTHOXy0lu6vA_lwiU6nEH9xx1fjeos_GYeiPMLV2bTK-fP_JYOFhG4crMv3cqIqnr_8xakReVIa4efXlFYer86hf6TvXuYFqBgIugcFIfdCHmApyh-AQztvi878EfHXKXhRnq4nq5hTXOxewGOI3kGndCD_JsrTHJUneM-bS4ryBcTu_A38_G-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