This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Wrong name in error messages (egcs-19990907)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]