http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50108

             Bug #: 50108
           Summary: [C++0x] Variadic templates with both type and non-type
                    parameters
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: edward.sch...@trash-mail.com


I'm not quite sure if this is a GCC bug, because the current C++ draft version
is unclear about this. I found neither an example that this code is ill-formed,
nor did I found an example that it's ok:


template<int... Ints, typename... Types>
class test_template
{
};

int main()
{
    test_template<1,2,3,int,double> tt;
    return 0;
}


GCC 4.6.1 rejects this code with the error "parameter pack 'Ints' must be at
the end of the template parameter list".

I guess the code is well-formed, because it is unambiguous and (semantically)
identical with the following code (that works fine in GCC):


template<int Int0, typename... Types>
class test_template
{
};

template<int Int0, int Int1, typename... Types>
class test_template
{
};

template<int Int0, int Int1, int Int2, typename... Types>
class test_template
{
};

Reply via email to