[LLVMbugs] [Bug 20482] New: [C++11] The template parameter pack of a function template should be the last template parameter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 29 09:09:48 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20482

            Bug ID: 20482
           Summary: [C++11] The template parameter pack of a function
                    template should be the last template parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kariya_mitsuru at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

==============================================
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/7Xl64RRorrf0L1vR

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140729/8156183a/attachment.html>


More information about the llvm-bugs mailing list