c++/9887: Syntax error on explicit member function template argument in function template body

Wolfgang Bangerth bangerth@ticam.utexas.edu
Mon Mar 3 19:00:00 GMT 2003


> >     Not a bug. You need to write
> >         x.template f<int>(); // syntax error
> >     (note the "template" keyword here).
> 
> It seems that it would save you (and users) a lot of time if the
> diagnostic just said that.

That might well be true.

> I wonder how difficult it would be to
> enhance the parser to detect this (along with the missing typename)
> as a special case and give a better error message.

Unfortunately, I can't comment on this, having no knowledge of the 
compiler itself. It would certainly be nice to have this - in general, it 
seems to me as if the error messages the new parser generates are 
not very helpful in a lot of cases. I have kept open several bug reports 
for this, but that would need work by those knowledgable of the parser.

Regards
  W.

-------------------------------------------------------------------------
Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                              www: http://www.ticam.utexas.edu/~bangerth/




More information about the Gcc-bugs mailing list