title: static constexpr pointer-to-function, difference between compilers
body: <p>When answering <a href="https://stackoverflow.com/questions/15866258/template-class-multiple-definition/15866315">this question</a>, I tried the following code with gcc (<a href="http://ideone.com/z7Rf49" rel="nofollow noreferrer">code compiled</a>) and clang (<a href="http://liveworkspace.org/code/PaAfb$0" rel="nofollow noreferrer">code rejected</a>):</p>
  
  <pre><code>typedef long (*func)(int);
  
  long function(int) { return 42; }
  
  struct Test
  {
      static constexpr func f = &amp;function;
  };
  
  template&lt;func c&gt;
  struct Call
  {
      static void f()
      {
          c(0);
      }
  };
  
  int main()
  {
      Call&lt;Test::f&gt;::f();
  }
  </code></pre>
  
  <p>I am not sure which compiler is right, although I think the constexpr initialization of <code>Test::f</code> is ok. The error clang outputs is:</p>
  
  <pre><code>error: non-type template argument for template parameter of pointer type 'func'
         (aka 'long (*)(int)') must have its address taken
  </code></pre>
  
  <ol>
  <li>Which compiler is right ?</li>
  <li>If clang is right, why , and what does this error really means ?</li>
  </ol>
  
  <p><strong>EDIT</strong>: for the "why", see <a href="https://stackoverflow.com/questions/15885399/pointer-as-non-type-template-argument">DyP's question</a>.</p>