public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian-huber@web.de>
To: gcc-help@gcc.gnu.org
Subject: Re: GCC compile problem ...
Date: Fri, 27 Sep 2002 15:52:00 -0000	[thread overview]
Message-ID: <200209280052.38305.sebastian-huber@web.de> (raw)
In-Reply-To: <B9B9F22C.4AB1%eljay@adobe.com>

Hello John,

On Friday 27 September 2002 09:31, John Love-Jensen wrote:
> Hi Gerhard,
>
> The TEMPORARY from test.getString is being set to a REFERENCE.
>
> The TEMPORARY is destructed, more-or-less, after the semicolon that set the
> string reference to the temporary.
>
> The cout << s << "\n"; is operating on the s string that has been
> destructed, which is very dangerous.

I think, that this is not true. If you assign a temporary object to a constant 
reference, the object will survive until the reference is destroyed.

> Who knows what state that freed STACK
> memory and HEAP memory will be in, especially during the machinations of
> the ostream processing.
>
> Borland C++ 5.5 and Microsoft Visual C++ 6.0 should be ashamed.  Shame.
> Shame.
>
> --Eljay

Bye

  reply	other threads:[~2002-09-27 22:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-27  9:09 gcc
2002-09-27  9:30 ` Sebastian Huber
2002-09-27  9:35 ` John Love-Jensen
2002-09-27 15:52   ` Sebastian Huber [this message]
2002-09-30  4:49     ` John Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2000-01-26  6:51 gcc " Brian J. Dent
2000-01-26 12:10 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` Brian J. Dent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200209280052.38305.sebastian-huber@web.de \
    --to=sebastian-huber@web.de \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).