Where to place gcc function attribute in auto function
<p>I'm trying to use gcc function attribute on an auto function with trailing type, but gcc compiler keeps rejecting the code. I'm basing the position of the gcc attribute on the examples here:</p>

<p><a href="https://gcc.gnu.org/onlinedocs/gcc-4.3.5/gcc/Function-Attributes.html" rel="nofollow noreferrer">https://gcc.gnu.org/onlinedocs/gcc-4.3.5/gcc/Function-Attributes.html</a></p>

<pre><code>  // ok
  int my_int_gcc_func ()
  __attribute__(( abi_tag ("tag1") , weak )) //ok
  ;

  // error
  auto my_auto_gcc_func_not_working ()
  __attribute__(( abi_tag ("tag2") , weak )) // error
  -&gt; int
  // cant place attribute here, get different warning..
  ;
</code></pre>

<p>The reference documents place the attribute immediately after the function parameters.</p>

<p>I noticed by trial and error that I can move the attribute keyword in front of the entire function declaration, but can't find any formal specification saying that this is allowed/supported by gcc...</p>

<pre><code>  // ok
  __attribute__(( abi_tag ("tag2") , weak )) // seems ok
  auto my_auto_gcc_func_no_error ()
  -&gt; int
  ;
</code></pre>