noexcept specifier mysteriously breaks compilation (clang, gcc disagree) : <p>The code in question is</p>

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

template &lt;typename F&gt;
void for_each(F&amp;&amp;) noexcept {}

template &lt;typename F, typename T, typename... Us&gt;
void for_each(F&amp;&amp; f, T&amp;&amp; v, Us&amp;&amp;... us) {
  std::invoke(std::forward&lt;F&gt;(f), std::forward&lt;T&gt;(v));
  for_each(std::forward&lt;F&gt;(f), std::forward&lt;Us&gt;(us)...);
}

void func(void*) noexcept {}

int main() {
  for_each(func, nullptr);
}
</code></pre>

<p>It compiles on <a href="https://wandbox.org/permlink/kWMYa4q1zkkYOJlR" rel="noreferrer">gcc 8</a>, but fails on <a href="https://wandbox.org/permlink/BBNBHck5NFIrvLGx" rel="noreferrer">clang 6</a> with the following error:</p>

<pre><code>/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4198:19: error: invalid application of 'sizeof' to a function type
    static_assert(sizeof(_Tp) &gt; 0, "Type must be complete.");
                  ^~~~~~~~~~~
/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4203:15: note: in instantiation of template class 'std::__1::__check_complete&lt;void (void *) noexcept&gt;' requested here
    : private __check_complete&lt;_Tp&gt;
              ^
/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4496:15: note: in instantiation of template class 'std::__1::__check_complete&lt;void (&amp;)(void *) noexcept&gt;' requested here
    : private __check_complete&lt;_Fp&gt;
              ^
/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4559:9: note: in instantiation of template class 'std::__1::__invokable_r&lt;void, void (&amp;)(void *) noexcept, nullptr_t &amp;&amp;&gt;' requested here
        __invokable&lt;_Fp, _Args...&gt;::value,
        ^
/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4568:14: note: in instantiation of template class 'std::__1::__invoke_of&lt;void (&amp;)(void *) noexcept, nullptr_t &amp;&amp;&gt;' requested here
    : public __invoke_of&lt;_Fp, _Args...&gt;
             ^
/opt/wandbox/clang-6.0.0/include/c++/v1/type_traits:4573:22: note: in instantiation of template class 'std::__1::result_of&lt;void (&amp;(nullptr_t &amp;&amp;))(void *) noexcept&gt;' requested here
template &lt;class _Tp&gt; using result_of_t = typename result_of&lt;_Tp&gt;::type;
                     ^
/opt/wandbox/clang-6.0.0/include/c++/v1/functional:2349:1: note: in instantiation of template type alias 'result_of_t' requested here
result_of_t&lt;_Fn&amp;&amp;(_Args&amp;&amp;...)&gt;
^
prog.cc:9:3: note: while substituting deduced template arguments into function template 'invoke' [with _Fn = void (&amp;)(void *) noexcept, _Args = &lt;nullptr_t&gt;]
  std::invoke(std::forward&lt;F&gt;(f), std::forward&lt;T&gt;(v));
  ^
prog.cc:16:3: note: in instantiation of function template specialization 'for_each&lt;void (&amp;)(void *) noexcept, nullptr_t&gt;' requested here
  for_each(func, nullptr);
  ^
1 error generated.
</code></pre>

<p>Remove the <code>noexcept</code> specifier on <code>func()</code></p>

<pre><code>void func(void*) /* noexcept */ {}
</code></pre>

<p>It then compiles. I don't get this. Is this a compiler bug? </p>
