Bug report (Template_arg::user_type)

Alexandre Oliva oliva@lsd.ic.unicamp.br
Sun Oct 31 23:03:00 GMT 1999


On Oct  1, 1999, "Valery Vybornov" <vvv@west-call.com> wrote:

> The (legal) code attached produces inadequate error messages. Reason
> seems to be in 's::ref' expression

Yup.  Since `s' is template-dependent, `s::ref' must be preceded by
the `typename' keyword if it is to be parsed as a type name:

> 	s::ref x;		//Error: parse error 
      ^ insert `typename' here
> 	f1< s::ref>(o.rv, 0); 	//Error: no matching function
           ^ and here

> The code compiles and works well under Microsoft compiler
> (ver. 12.00.8168; MSVC 6.0)

It shouldn't.  The code is not compliant with the ANSI/ISO C++
Standard.

-- 
Alexandre Oliva http://www.dcc.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