This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17000] parse error calling member template function of non-lvalue from within template class member
- From: "ddneilson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Apr 2007 17:51:08 -0000
- Subject: [Bug c++/17000] parse error calling member template function of non-lvalue from within template class member
- References: <bug-17000-3238@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from ddneilson at gmail dot com 2007-04-20 18:51 -------
(In reply to comment #9)
> (In reply to comment #8)
> > The work around is doing:
> > get_a().template func2 <int>();
> >
> >
> > Which tells the compiler for sure func2 is a template.
> >
>
> Thanks, yeh I figured that out just now. Should it happen like this though?
> Surely the compiler should be able to work out it's a template and therefore
> not need the qualification?
>
I was just about to report a similar bug, but it was also "fixed" by adding a
"template" qualifier to the function call.
However, when studying the bug I ran my test case through the xlC compiler. It
compiles "get_a().func2<int>();" just fine; it doesn't need "get_a().template
func2<int>();" syntax.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17000