This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52350] Parse error calling a template method in a template class
- 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: Thu, 23 Feb 2012 10:28:48 +0000
- Subject: [Bug c++/52350] Parse error calling a template method in a template class
- Auto-submitted: auto-generated
- References: <bug-52350-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52350
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-23 10:28:48 UTC ---
Not a bug, all conforming compilers will reject this code (e.g. try it at
http://www.comeaucomputing.com/tryitout/ or http://llvm.org/demo to check)
You need to say:
return factory.template constructT<T>();
because factory is a dependent name and the compiler doesn't know that
factory.constructT is a template (it could be a data member being compared with
less-than)
See http://womble.decadent.org.uk/c++/template-faq.html#disambiguation