How to static cast throwing function pointer to noexcept in C++17? : <p>C++17 makes <code>noexcept</code> part of a function's type. It also allows implicit conversions from <code>noexcept</code> function pointers to potentially throwing function pointers.</p>

<pre><code>void (*ptr_to_noexcept)() noexcept = nullptr;
void (*ptr_to_throwing)() = ptr_to_noexcept;  // implicit conversion
</code></pre>

<p><a href="http://eel.is/c++draft/expr.static.cast#7" rel="noreferrer">http://eel.is/c++draft/expr.static.cast#7</a> says that <code>static_cast</code> can perform the inverse of such a conversion.</p>

<pre><code>void (*noexcept_again)() noexcept = static_cast&lt;void(*)() noexcept&gt;(ptr_to_throwing);
</code></pre>

<p>Unfortunately, both GCC and clang tell me otherwise: <a href="https://godbolt.org/z/TgrL7q" rel="noreferrer">https://godbolt.org/z/TgrL7q</a></p>

<p>What is the correct way to do this? Are <code>reinterpret_cast</code> and C style cast my only options?</p>
