[Bug c++/52768] New: Unable to get pointer to template function

2012-03-29 Thread kmakaron11 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52768

 Bug #: 52768
   Summary: Unable to get pointer to template function
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kmakaro...@gmail.com


GCC 4.6.3, as well as GCC 4.8 cannot resolve template method, even if it is
explicitly instantiated.
The code to explain the problem is:

template 
struct Creator
{
template 
static std::shared_ptr create(Ts&&... vs)
{
std::shared_ptr t(new T(std::forward(vs)...));
return t;
}
};

class Car:
public Creator
{
private:
friend class Creator;
Car()
{
}
};

int main()
{
std::function< std::shared_ptr () > createFn=&Car::create<>;

return 0;
}

This results in following compiler error:
error: conversion from β€˜β€™
   to non-scalar type β€˜std::function()>’ requested

However it compiles fine on Clang3.0 and 3.1.


[Bug c++/52768] cannot resolve address of function template with empty template argument list

2012-03-29 Thread kmakaron11 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52768

--- Comment #3 from kmakaron11 at gmail dot com 2012-03-29 13:25:11 UTC ---
I am sorry, Jonathan Wakely. This is my first GCC bug report.
Next time I will, try to put the fallout to minimum.