This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Why does this not compile?


On May 19, 2002, "Harron, Vince" <vharron@soe.sony.com> wrote:

> I've read a lot but I can't seem to find any references on this problem.  It
> seems to be a reasonable construct.  Why have you decided to forbid this?  

Because the C++ Standard says so.  You can't bind a temporary to a
reference to non-const.  -fpermissive might get gcc to accept the
code, but don't count on that from C++ compilers in general.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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