title: clang-format: Setting to control C++ attributes
body: <p>Searching through the <a href="https://clang.llvm.org/docs/ClangFormatStyleOptions.html" rel="noreferrer">Clang-Format Style Options</a>, I can't seem to find a way to control the behavior on the placement of C++ attributes.</p>
  
  <p>As an example, take these two declarations, the first of which does not overflow the column limit and the second of which does:</p>
  
  <pre><code>template &lt;typename TChar&gt;
  [[gnu::always_inline]]
  static ptr&lt;TChar&gt; within_limit(ptr&lt;TChar&gt; first, ptr&lt;TChar&gt; last);
  
  template &lt;typename TChar, typename FApply, typename... FApplyRest&gt;
  [[gnu::always_inline]]
  static ptr&lt;TChar&gt; overflow(ptr&lt;TChar&gt; first, ptr&lt;TChar&gt; last, const FApply&amp; apply, const FApplyRest&amp;... apply_rest);
  </code></pre>
  
  <p>No matter how I tweak my <code>.clang-format</code>, the output is some variant of this:</p>
  
  <pre><code>[[gnu::always_inline]] static ptr&lt;TChar&gt; within_limit(ptr&lt;TChar&gt; first, ptr&lt;TChar&gt; last);
  
  [[gnu::always_inline]] static ptr&lt;TChar&gt;
  overflow(ptr&lt;TChar&gt; first, ptr&lt;TChar&gt; last, const FApply&amp; apply, const FApplyRest&amp;... apply_rest);
  </code></pre>
  
  <p>Having the attributes on the same line as the type is rather unreadable (to me), so I would prefer <code>clang-format</code> not do this. Using <code>__attribute__((always_inline))</code> exhibits the same behavior. Specifying multiple attributes in a single list (<code>[[noreturn, gnu::cold]]</code>) causes reformatting (to <code>[[ noreturn, gnu::cold ]]</code> for reasons unclear to me). The formatter has at least some basic understanding of attributes.</p>
  
  <p><strong>SO:</strong> Is there a way to get <code>clang-format</code> to put attributes on their own line (the C++ equivalent to <code>BreakAfterJavaFieldAnnotations</code>)?</p>
  
  <hr>
  
  <p><strong>Attempted Workarounds</strong></p>
  
  <p>Use of <code>// clang-format off</code>/<code>// clang-format on</code> is an <em>okay</em> stopgap, but it is definitely too ham-handed for a permanent solution. I still want the declaration formatted properly. Aside from that, the project requires the use of a lot of attributes, so having <code>clang-format</code> comments everywhere is arguably less readable.</p>
  
  <p>Use of <code>CommentPragmas</code> theoretically would allow me to be more localized in disabling, but the output is still quite odd:</p>
  
  <pre><code>template &lt;typename TChar&gt;
  [[gnu::always_inline]] // NO-FORMAT: Attribute
      static ptr&lt;TChar&gt;
      within_limit(ptr&lt;TChar&gt; first, ptr&lt;TChar&gt; last);
  </code></pre>