This is the mail archive of the
mailing list for the GCC project.
Re: temporary object
- From: Joe Buck <jbuck at synopsys dot com>
- To: He HongFu <hhfesle1982 at 163 dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 27 Aug 2003 09:11:48 -0700
- Subject: Re: temporary object
- References: <20030827094856.524381C7A91B2@sm204.163.com>
On Wed, Aug 27, 2003 at 05:46:50PM +0000, He HongFu wrote:
> Hi, All
> Why I cannot compile it when I use a temporary object as an parameter of a reference.
> but MSC can compile it sucessfully.
This is a bug in MSC. It's not legal to initialize a non-const reference
with a temporary object.