public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57397] New: Off-by-one error in diagnostic when calling variadic function template with too few arguments
@ 2013-05-24 12:27 redi at gcc dot gnu.org
  2013-05-24 12:34 ` [Bug c++/57397] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-24 12:27 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-30 20:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24 12:27 [Bug c++/57397] New: Off-by-one error in diagnostic when calling variadic function template with too few arguments redi at gcc dot gnu.org
2013-05-24 12:34 ` [Bug c++/57397] " paolo.carlini at oracle dot com
2013-05-24 12:43 ` redi at gcc dot gnu.org
2013-05-24 13:19 ` daniel.kruegler at googlemail dot com
2013-05-24 17:20 ` paolo.carlini at oracle dot com
2013-05-24 17:22 ` paolo.carlini at oracle dot com
2014-07-30 20:07 ` paolo at gcc dot gnu.org
2014-07-30 20:08 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).