title: C++ function-to-pointer implicit conversion: which compiler is right? Clang and GCC disagree
body: <pre class="lang-cpp prettyprint-override"><code>template &lt;typename Type, Type Func&gt;
  struct A
  {
  };
  
  void func();
  
  A&lt;void(), func&gt; a; // same result with A&lt;void(), &amp;func&gt; a;
  </code></pre>
  
  <p>This code compiles with Clang (including latest 8.0.0), but not with GCC (including latest 9.1).</p>
  
  <p>GCC says: <code>error: 'void()' is not a valid type for a template non-type parameter</code></p>
  
  <p>Which compiler is right and why?</p>
  
  <h1>Update</h1>
  
  <p>I am guessing GCC is wrong, because the following compiles on both Clang and GCC:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template &lt;void()&gt;
  struct A
  {
  };
  
  void func();
  
  A&lt;func&gt; a; // same result with A&lt;&amp;func&gt; a;
  </code></pre>
  
  <p>So contrary to what GCC reports in the first example, <code>void()</code> seems to be "a valid type for a template non-type parameter"</p>