This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25610] 'invalid use of member' error on correct code with templates
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Dec 2005 02:35:25 -0000
- Subject: [Bug c++/25610] 'invalid use of member' error on correct code with templates
- References: <bug-25610-6649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-12-31 02:35 -------
Subject: Re: New: 'invalid use of member' error on correct code with
templates
On Dec 30, 2005, at 9:31 PM, yuri at tsoft dot com wrote:
> template<class A>
> struct S {
> static inline void exec1(A &vv) {
> vv.s1<1>(1);
> }
> };
>
You are missing a template keyword.
You want:
vv.template s1<1>(1);
Otherwise you end up with (vv.s1 < 1) > 1 as there is no way for a
compiler
to know that vv.s1 is a template as vv is dependent.
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25610