public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104343] Too many arguments error reported for a variadic-argument function if std::endl is passed
Date: Wed, 02 Feb 2022 17:33:30 +0000	[thread overview]
Message-ID: <bug-104343-4-wvaEVQXYYY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104343-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104343

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang gives:

x.C:11:3: error: no matching function for call to 'Sprint'
  Sprint("B: off=", 2, " now=", 3, endl);
  ^~~~~~
x.C:5:13: note: candidate template ignored: substitution failure: deduced
incomplete pack <char const (&)[8], int, char const (&)[6], int, (no value)>
for template parameter 'Args'
inline void Sprint(Args&&... args)
            ^
1 error generated.


The "(no value)" is the clue here.

EDG says:

"x.C", line 11: error: no instance of function template "Sprint" matches the
          argument list
            argument types are: (const char [8], int, const char [6], int,
                      <unknown-type>)
    Sprint("B: off=", 2, " now=", 3, endl);
    ^

1 error detected in the compilation of "x.C".


I'm surprised GCC doesn't say "<unresolved overloaded function type>"

  parent reply	other threads:[~2022-02-02 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 13:19 [Bug c++/104343] New: " ethouris at gmail dot com
2022-02-02 14:17 ` [Bug c++/104343] " rguenth at gcc dot gnu.org
2022-02-02 17:13 ` redi at gcc dot gnu.org
2022-02-02 17:15 ` redi at gcc dot gnu.org
2022-02-02 17:31 ` redi at gcc dot gnu.org
2022-02-02 17:33 ` redi at gcc dot gnu.org [this message]
2022-02-02 21:25 ` [Bug c++/104343] improved error message for passing overloaded function to variadic-argument function pinskia at gcc dot gnu.org
2024-03-16 18:11 ` [Bug c++/104343] improved error message for passing overloaded function to variadic(templated)-argument function pinskia at gcc dot gnu.org
2024-03-17  6:07 ` f.heckenbach@fh-soft.de
2024-03-17  6:17 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104343-4-wvaEVQXYYY@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).