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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] AllowShortFunctionsOnASingleLine doesn't affect template functions 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

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

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

<pre>
    `AllowShortFunctionsOnASingleLine` setting is not working for template functions, when `AlwaysBreakTemplateDeclarations` is set to `Yes`.

Sample code:
```
template <typename T>
void foo()
{
}

void bar() {}

template <typename T>
struct S
{
    template <typename U>
    void foo()
    {
    }

    void bar() {}
};
```
Configuration:
```
BasedOnStyle: Microsoft

AlwaysBreakTemplateDeclarations: Yes
AllowShortFunctionsOnASingleLine: All
```

Non-template functions and methods are formatted according to the configuration, while template function bodies are always put on a new line. `AlwaysBreakTemplateDeclarations` should affect only the template declaration part, and let the rest to be put on a single line if specified.

Same issue happens also for `Inline`, `InlineOnly` options.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM-P6yYQ_mvwZbQRgdjeHHxINo1Uqe0e8nroEcPYpg-DBXij_PcVOJv98bLaShY2-JuZb2a-QYSge4vYkHJPykMh5jg43yjxopV4wXgRtmidujSkojtj3Pk0OB-Ps5VROxue7e6kbW_wD22RVBQCxqhtDzqAdRHOzv9M2855iDhORkSE7tWasCc4D2ghOz-LS9h7FD9_XIEHlEZ4sUArmnwGjBBdwv-D6WxF6IHQ3bKexDgZBOkUEn49IxW9Pnl740D4U7xMaMWI8IPw35bfL04r6Jwj7JGw7dVDvX_9OLyPlrGt8AsWEuwj4JtYIfpZRjh9igIAcNfy75tlgtxjms4_-PlE6Gb3Bev6QPj-btmenO10Py-9-Kq2exFQPdtTvJhUf_hTS--C6-J7Dt-1me8gdfaK_UZvfAc7Y-6SWda_nH34VXYgrIIR4-BUAOExqXMUMaICIaXzKik2OohDEtP7zLNetcFftQytUxoXdyLnCNMcwVkQYPEMRltc_U-dh8HNRoHoOpTJhblkKreY6g0Pk_Ax0UopmTQcA4LHkKekxTcOIVct0wDdQZhQ6k6j-jxACDqEGWEQ04SpVCa4PL2kor9bs0x5CnjbP1tzSazdlBO4OixUw9WWb0WBzbqmm4pvOCuLoUG6WUsh17wVuK24bLdMolRclRUTXVkVumGUbeia1mvOGS1X9FHRUpVl_bjGjZCMbCiOQpuVMS_jyvm-yJSbumb8sTCiRRPydcaYNML2D0t7CWPpgvNNMnto5z6QDTU6xPDmKOpo8lX4wbA8wHdSBOUwWMLq-Nq2O7IrZm-aIcYpyZywI2HHXsdhblfSjYQdE43r62Hy7l-UkbBjTi4Qdsz5_RcAAP__neLMrw">