From -4610582630637980138
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8fdf6b501ff64059
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-01-08 07:20:03 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Al Grant" <tnarga@arm.REVERSE-NAME.com>
Newsgroups: comp.std.c++
Subject: Re: Possible DRs
Date: Tue,  8 Jan 2002 15:19:36 GMT
Organization: ARM Limited
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <a1edtj$9bq$1@cam-news1.cambridge.arm.com>
References: <dPlZ7.4047$cD4.7483@www.newsranger.com> <3C36019C.32739F68@sensor.com> <5lof3uk2f6t89sd4ohotn0lvmrqv8pr0s3@4ax.com>
X-Trace: mail2news.demon.co.uk 1010503189 mail2news:6685 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
NNTP-Posting-Date: 8 Jan 2002 09:25:07 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Lines: 42
Xref: archiver1.google.com comp.std.c++:8872

"Stephen Clamage" <stephen.clamage@sun.com> wrote in message
news:5lof3uk2f6t89sd4ohotn0lvmrqv8pr0s3@4ax.com...
> On Fri,  4 Jan 2002 19:25:10 GMT, Ron Natalie <ron@sensor.com> wrote:
> >>
> >> 7) This one is really obscure. A union can contain two members
> >> ( with subobjects ) such that these subobjects overlap. Is it legal
> >> to assign one sucg object to another?
> >
> >This is a good one.
>
> Section 5.17, paragraph 8:
>
> If the value being stored in an object is accessed from another object
> that overlaps in any way the storage of the first object, then the
> overlap shall be exact and the two objects shall have the same type,
> otherwise the behavior is undefined.

What does "accessed from" mean?  Does it mean "loaded from
without an intervening sequence point"?  Because surely it
is acceptable to load a value from a subobject into something,
take a sequence point, and then store the value into an
overlapping subobject.

Given the function
  S f(S *s) { return *s; }
is it defined to pass one subobject and assign the result to an
overlapping subobject?  1.9#17 says there is a sequence point
between the copying of the return value (i.e. from *s, to
wherever the return value is) and the evaluation of any
expression outside the function.

What about
  S f(S *s) { S x = *s; return x; }



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



