std::function with noexcept in C++17
<p>In C++17 <code>noexcept</code> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html" rel="noreferrer">has been added to the type system</a>:</p>

<pre><code>void r1( void (*f)() noexcept ) { f(); }
void foo() { throw 1; }

int main()
{
    r1(foo);
}
</code></pre>

<p>The latest versions of GCC and Clang in C++17 mode reject the call <code>r1(foo)</code>, because <code>void (*)()</code> cannot be implicitly converted to <code>void (*)() noexcept</code>.</p>

<p>But with <code>std::function</code> instead:</p>

<pre><code>#include &lt;functional&gt;

void r2( std::function&lt;void() noexcept&gt; f ) { f(); }
void foo() { throw 1; }

int main()
{
    r2(foo);
}
</code></pre>

<p>Clang accepts the program, apparently ignoring the <code>noexcept</code> specifier; and <code>g++</code> gives a strange error regarding <code>std::function&lt;void() noexcept&gt;</code>.</p>

<p>What is the correct behaviour for this second program in C++17?</p>