[Bug c++/50086] [C++0x] Error on lookup of template function address with variadic template arguments

2011-08-17 Thread edward.sch...@trash-mail.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50086

--- Comment #4 from edward.sch...@trash-mail.com 2011-08-17 08:24:52 UTC ---
Nice. Thanks a lot. :)


[Bug c++/50108] New: [C++0x] Variadic templates with both type and non-type parameters

2011-08-17 Thread edward.sch...@trash-mail.com
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
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
class test_template
{
};

template
class test_template
{
};

template
class test_template
{
};


[Bug c++/50086] New: Error on lookup of template function address with variadic template arguments

2011-08-15 Thread edward.sch...@trash-mail.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50086

 Bug #: 50086
   Summary: Error on lookup of template function address with
variadic template arguments
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


G++ 4.6.1 fails to get the address of a template function if it's passed to a
variadic argument list:


template
void tfun() { }

template
void fun1(T(*)())
{
cout << "hello world" << endl;
}

template
void fun2(Types... args)
{
fun1(args...);
}

int main()
{
fun1(tfun); // ok, prints hello world
fun2(tfun); // error: unresolved overloaded function type
return 0;
}