gcc7 lambda expression return type without arrow : <p>I wrote the following by accident and got no warning with gcc 8:</p>

<pre><code>auto f = []() bool {};
</code></pre>

<p>I've never heard or read anything about the previous syntax. My intent was to write:</p>

<pre><code>auto f = []() -&gt; bool {};
</code></pre>

<p>And in this case gcc issues the very useful warning I expected: <code>no return statement</code>.</p>

<p>I did some experiments and GCC accepts the first syntax without warnings or errors since at least GCC 7.1 but not with GCC 6.3. No other compilers seem to accept it. Also, the first syntax is accepted for native types: <code>bool</code> <code>int</code> <code>float</code> and such but not for classes such as<code>struct A {};</code></p>

<p>Is this a bug or Is this a new c++17 or c++20 syntax related to, for instance, attributes?</p>
