title: Too many template parameters in template redeclaration
body: <p>.</p>
  
  <p>Hi :-)</p>
  
  <p>I have the following code : the goal is to return a function that is the sum of other functions, roughly. And to learn about variadic templates.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template &lt;typename F&gt;
  struct FSum {
      FSum(F f) : f_(f) {} ;
      int operator()() {
          return f_() ;
      }
      F f_ ;
  } ;
  template &lt;typename F1, typename F2, typename... Frest&gt;
  struct FSum {
      FSum(F1 f1, F2 f2, Frest... frest) {
          f_ = f1 ;
          frest_ = FSum&lt;F2, Frest...&gt;(f2, frest...) ;
      }
      int operator()() {
          return f_() + frest_() ;
      }
      F1 f_ ;
      FSum&lt;F2, Frest...&gt; frest_ ;
  } ;
  
  struct F1 {
      int operator() () { return 1 ; } ; 
  } ;
  struct F2 {
      int operator() () { return 2 ; } ; 
  } ;
  struct F3 {
      int operator() () { return 3 ; } ; 
  } ;
  
  int main() {
      F1 f1 ; 
      F2 f2 ;
      F3 f3 ;
      FSum&lt;F1, F2, F3&gt; fsum = FSum&lt;F1, F2, F3&gt;(f1, f2, f3) ;
      std::cout &lt;&lt; fsum() &lt;&lt; std::endl ;
  }
  </code></pre>
  
  <p>But I got the following error message from clang (g++ also gives an error) :</p>
  
  <blockquote>
    <p>test_variadic.cpp:14:1: error: too many template parameters in
    template
          redeclaration template  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
  </blockquote>
  
  <p>And well I don't understand. I though the compiler would choose the class depending on the number of template parameters ? Since the first one has exactly one and the other one has 2 or more.</p>
  
  <p>Any idea ?</p>
  
  <p>Thanks a lot :-)</p>