This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-29 13:02:14 UTC ---
(In reply to comment #0)
> The code to explain the problem is:

No it isn't, it's missing several include files.  I know it's "obvious" which
ones they are, but if five different people all look at the bug report and try
to reproduce the behaviour then they all have to figure it out and modify the
code.  You'd save everyone time by providing a *complete* testcase, as clearly
requested by the bug submissions guidelines.

A complete example would be:

template<typename Res>
struct function
{
    template<typename F> function(F) { }
};

template <class T>
struct Creator
{
    template <typename...Ts>
    static T* create(Ts&&... vs)
    {
        return new T(vs...);
    }
};

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

int main()
{
    function< Car* () > createFn=&Car::create<>;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]