g++ 2.95.2 bug report

Alexandre Oliva oliva@lsd.ic.unicamp.br
Fri Dec 31 20:54:00 GMT 1999


On Dec  9, 1999, Martin Sebor <sebor@roguewave.com> wrote:

> template <class T, class U>
> void bar (T, U)
> {
>     B<int> b;
>     b.foo <A<T, U> > ();

This is a known bug of C++ parser of gcc.  It currently requires the
`template' keyword to precede member templates with explicit template
arguments in all cases, but it should only require it when the type of
the object that contains the member is template-dependent.

For short, to work around this GCC bug, you must write:

#if GCC_IS_BUGGY
# define NEEDLESS_TEMPLATE_KEYWORD template
#else
# define NEEDLESS_TEMPLATE_KEYWORD
#endif

      b. NEEDLESS_TEMPLATE_KEYWORD foo <A<T, U> > ();

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



More information about the Gcc-bugs mailing list