title: Deduction and parameter pack that is not the last template parameter: is this valid code?
body: <p>Consider the following minimal example:</p>
  
  <pre><code>template&lt;typename... A, typename R&gt;
  void f(A&amp;&amp;..., R(*)(A...)) {}
  
  void g(int, char) {}
  
  int main() {
      f&lt;int, char&gt;(42, 'c', g);
  }
  </code></pre>
  
  <p>The parameter pack <code>A</code> is not the last parameter.<br>
  Anyway, I thought <code>R</code> could have been deduced from the function pointer because of <a href="http://eel.is/c++draft/temp#param-11" rel="nofollow">[temp.param]/11</a>.</p>
  
  <p>GCC (6.2) <a href="https://godbolt.org/g/8QCAcn" rel="nofollow">agrees with me</a> on this, while clang (3.9) <a href="https://godbolt.org/g/YFtfW2" rel="nofollow">rejects the code</a> and says that it <em>could not infer template argument <code>R</code></em>.</p>
  
  <p>Was my expectation wrong, thus GCC shouldn't accept it, or is an issue of clang? </p>