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++/25610] 'invalid use of member' error on correct code with templates



------- 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



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