This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why does this not compile?
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Harron, Vince" <vharron at soe dot sony dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: 19 May 2002 15:54:17 -0300
- Subject: Re: Why does this not compile?
- Organization: GCC Team, Red Hat
- References: <9EAA79BA8878D511B5BD00D0B7B75313054BE7FF@mail-sd.station.sony.com>
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