Wrong name in error messages (egcs-19990907)

Alexandre Oliva oliva@lsd.ic.unicamp.br
Thu Sep 30 19:57:00 GMT 1999


On Sep 14, 1999, Jeroen@MMR.be wrote:

>   template <class C> void f(int p, C& c)
[snip]

>       f(p,  A<T>()); // line 25: doesn't work

Yup, you can't bind a reference to non-const to a temporary.  If you
declare f as taking int and const C&, it will work.

>       f(p, (A<T>()));  // line 28:workaround as suggested in FAQ (Parse Errors for simple code)

I believe the hard-to-fix error in the parser causes this to be
parsed as a type cast whose argument is missing.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,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