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

    <tr>
        <th>Summary</th>
        <td>
            clang-format: Setting to control C++ attributes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          martingalvan-nordic
      </td>
    </tr>
</table>

<pre>
    See https://stackoverflow.com/questions/45740466/clang-format-setting-to-control-c-attributes

If we have e.g.

```
template <typename TChar>
[[gnu::always_inline]]
static ptr<TChar> within_limit(ptr<TChar> first, ptr<TChar> last);

template <typename TChar, typename FApply, typename... FApplyRest>
[[gnu::always_inline]]
static ptr<TChar> overflow(ptr<TChar> first, ptr<TChar> last, const FApply& apply, const FApplyRest&... apply_rest);
```

No matter how we tweak clang-format, the output is always something like this:

```
[[gnu::always_inline]] static ptr<TChar> within_limit(ptr<TChar> first, ptr<TChar> last);

[[gnu::always_inline]] static ptr<TChar>
overflow(ptr<TChar> first, ptr<TChar> last, const FApply& apply, const FApplyRest&... apply_rest);
```

There should be a way to configure clang-format not to move the attributes like that, as it complicates readability.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVE2Pm0AM_TVwsUCEr8CBQzbblXrpobv3lQED0x0YOmMS5d93IMkuG2lbtWqlShYZ_GLPs59xqepT8UgEHfNonGjnhA_WDGP1og6kG6mOfqV66_s-kWGhBmPPcbKNgzhN7bGSOLReo3SP7BliFvaVlVepgbWSXuUhsxblxGSc4N4Jdufn5waO9lo8EJDf-mvISYOLLa9M_SiRCZxoz6eRBuwJnvYdaif6dIlI7qy1wzRXEO1QHvFknsUgxUBOcj_b8j9bF4sKRrah-2sKOAruxPAsRS_YCbMbtBHaWPf-Nkri7M6d6G7N_SdkbYpXz8NuHOVp7fJ9_-L9avv8lyq7Svi7Ve3Bymf4lWYKeOW7BhamYTpTX_BnTTc9ea_k-flFgZ0VJg2dOs5DwEfCF1gP0tKYjkBNPE4MwsC5cDCqp1msFqR4sZGdWIb24-H5df_g3w_Fn5I4R_-XIj51pAlMpyZZQ0mAYGsCVnPqRrSTBdeCwqB4RntbzKLs21K4KnlWHQ0ItknsVyQqnGFNWGMppOCT79ZFVOdRji4LllS8m5loB4_n_XPhMe8f2DvhnbXVhe6kZfF-37VW7Km8LDopD9cfb9TqG1WW2YMwxi5Ae0jiME3crsirLEnLKs6jJAk3dZJv0xjTNNtsAtrGTe5KLEmaYhH_3hVFGIRhEAVZkCXbIPPrumw21FAW102UpJkTB9SjkP58sa906-pi4VBOrbGgFIbNG4jGiHYguubHiTulix713AGUBxy8QelaVO5CvVh4_wBxdODg">