On Wed, Oct 15, 2008 at 6:16 PM, David Vandevoorde <daveed at vandevoorde.com> wrote:> > An object is created by a definition (_basic.def_) > > basic.def doesn't contain the word "create" nor words to that effectThat should be [intro.object]: "An object is a region of storage. An object is created by a definition..."> Furthermore, basic.life 3.8/7 makes it clear that an object > may be created on top of another object, and the name of the first > object will correctly evaluate to the new object.That's irrelevant; for the case with two global chars, both of the objects are alive at the time in question per [basic.stc.static]. Anyway, I'm 99% sure that's supposed to be referring to user-allocated memory; the lifetime of an non-user-allocated object is permanently attached to its scope, so it's already gone before anything could be allocated on top of it.> The current consensus among CoreWG experts is that the words in thecurrent standard (and those in the current WP) do not require distinct variables and temporaries to have distinct addresses per se. Then what's the alternative model? -Eli
On Oct 16, 2008, at 12:22 AM, Eli Friedman wrote: [...]>> The current consensus among CoreWG experts is that the words in the > current standard (and those in the current WP) do not require distinct > variables and temporaries to have distinct addresses per se. > > Then what's the alternative model?That if two complete objects can never be distinguished by observing their value, then they may be allocated at the same address. Note that I don't think that model will have majority support when the issue is discussed (that's just a guess). However, the current words don't seem to make it an invalid model, and there is some suspicion that the changes for Core issue 73 that made it so were not entirely accidental. Daveed
On Thu, Oct 16, 2008 at 7:04 AM, David Vandevoorde <daveed at vandevoorde.com> wrote:> > On Oct 16, 2008, at 12:22 AM, Eli Friedman wrote: > [...] >>> The current consensus among CoreWG experts is that the words in the >> current standard (and those in the current WP) do not require distinct >> variables and temporaries to have distinct addresses per se. >> >> Then what's the alternative model? > > > That if two complete objects can never be distinguished by observing > their value, then they may be allocated at the same address.That's an extremely difficult model to deal with, even ignoring that it might break user code. It isn't too difficult to write a program where two complete objects can be distinguished by observing their value if and only if they are allocated at the same address. -Eli