http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57397

            Bug ID: 57397
           Summary: Off-by-one error in diagnostic when calling variadic
                    function template with too few arguments
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

template<class T1, class T2, class... Tn>
void foo(T1, Tn...)
{ }

int main()
{
    foo();
}

t.cc: In function 'int main()':
t.cc:7:9: error: no matching function for call to 'foo()'
     foo();
         ^
t.cc:7:9: note: candidate is:
t.cc:2:6: note: template<class T1, class T2, class ... Tn> void foo(T1, Tn ...)
 void foo(T1, Tn...)
      ^
t.cc:2:6: note:   template argument deduction/substitution failed:
t.cc:7:9: note:   candidate expects 2 arguments, 0 provided
     foo();
         ^


The function expects 1 or more arguments, saying 2 is entirely bogus.

Reply via email to