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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|WAITING                     |NEW

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
When creating the bug you were asked to read https://gcc.gnu.org/bugs which
makes it clear that a proper test case is required, not a snippet of incomplete
code.

Also, GCC 7 has been unsupported for a couple of years.

Here's a complete reproducer:

void endl(char);
void endl(wchar_t);

template <class Stream>
inline Stream& Print(Stream& in) { return in;}

template <class Stream, class Arg1, class... Args>
inline Stream& Print(Stream& sout, Arg1&& arg1, Args&&... args)
{
    return Print(sout, args...);
}

template <class... Args>
inline void Sprint(Args&&... args)
{
    int sout;
    Print(sout, args...);
}

int main()
{
  Sprint("B: off=", 2, " now=", 3, endl);
}

x.C: In function ‘int main()’:
x.C:22:9: error: too many arguments to function ‘void Sprint(Args&& ...) [with
Args = {}]’
   22 |   Sprint("B: off=", 2, " now=", 3, endl);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x.C:14:13: note: declared here
   14 | inline void Sprint(Args&&... args)
      |             ^~~~~~

Reply via email to