This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50108] New: [C++0x] Variadic templates with both type and non-type parameters
- From: "edward dot schere at trash-mail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Aug 2011 14:29:14 +0000
- Subject: [Bug c++/50108] New: [C++0x] Variadic templates with both type and non-type parameters
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: edward.schere@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
{
};