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]

Re: [Bug c++/25610] 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



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