This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong name in error messages (egcs-19990907)
- To: Jeroen at MMR dot be
- Subject: Re: Wrong name in error messages (egcs-19990907)
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Date: 14 Sep 1999 06:49:17 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <317DBCF02D2DD21181D60020AFD6970A1187C6@mmr.mmr.be>
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