public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61953] New: [C++11] The template parameter pack of a function template should be the last template parameter
@ 2014-07-29 16:23 kariya_mitsuru at hotmail dot com
  2014-12-14  0:42 ` [Bug c++/61953] " ville.voutilainen at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kariya_mitsuru at hotmail dot com @ 2014-07-29 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61953
           Summary: [C++11] The template parameter pack of a function
                    template should be the last template parameter
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kariya_mitsuru at hotmail dot com

The both sample codes below should cause compilation error but they are
compiled successfully by gcc.

==============================================
template<class... T, class... U> void f() { }
==============================================

===========================================
template<class... T, class U> void g() { }
===========================================

According to C++11 standard 14.1 Template parameters [temp.param] paragraph 11,
"A template parameter pack of a function template shall not be followed by
another template parameter unless that template parameter can be deduced from
the parameter-type-list of the function template or has a default argument."

The latest draft is more clarified using the following example.

=======================================================================
// U can be neither deduced from the parameter-type-list nor specified
template<class... T, class... U> void f() { } // error
template<class... T, class U> void g() { } // error
=======================================================================

cf. http://melpon.org/wandbox/permlink/zO14UQDvxpXwRfYm


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

end of thread, other threads:[~2021-08-12  1:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29 16:23 [Bug c++/61953] New: [C++11] The template parameter pack of a function template should be the last template parameter kariya_mitsuru at hotmail dot com
2014-12-14  0:42 ` [Bug c++/61953] " ville.voutilainen at gmail dot com
2014-12-14  0:42 ` ville.voutilainen at gmail dot com
2021-08-04 20:48 ` pinskia at gcc dot gnu.org
2021-08-12  1:17 ` pinskia at gcc dot gnu.org

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).