This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55576] Fails to compile a call to template member function
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Dec 2012 16:00:35 +0000
- Subject: [Bug c++/55576] Fails to compile a call to template member function
- Auto-submitted: auto-generated
- References: <bug-55576-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55576
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-12-03 16:00:35 UTC ---
I don't think this is a G++ bug, there are three problems with this code:
1) You need to #include <new> to use placement new
2) factory::apply is non-const but the parameter 'f' is const
3) f.template apply<T> finds the current instantiation, ::apply<T>, rather than
the member function you are trying to call, use f.FactoryT::template apply<T>
instead