title: overload resolution of template function with auto
body: <p>With the 3 following overloads</p>
  
  <pre><code>template &lt;class T&gt; auto foo() { return 1; }
  template &lt;class T&gt; int  foo() { return 2; }
  template &lt;class T&gt; T    foo() { return 3; }
  </code></pre>
  
  <p>Is the following ill formed ?</p>
  
  <pre><code>static_cast&lt;int(*)()&gt;(&amp;foo&lt;int&gt;)();
  </code></pre>
  
  <p>Clang selects overload #2, whereas gcc fails to compile (<a href="http://coliru.stacked-crooked.com/a/f805467081c1c419" rel="noreferrer">Demo</a>)</p>
  
  <p>When removing overload #1, both agree to select overload #2 (<a href="http://coliru.stacked-crooked.com/a/82de6eb2336a5282" rel="noreferrer">Demo</a>).</p>
  
  <p>When removing overload #2, gcc selects overload #1 and clang fails to compile (<a href="http://coliru.stacked-crooked.com/a/28428c56e6e77756" rel="noreferrer">Demo</a>)</p>