Since P0593 Implicit creation of objects for low-level object manipulation has been accepted, objects may now be created implicitly in C++20.
Specifically the wording introduced by the proposal allows certain operations (such as std::malloc
) to automatically create and start the lifetime of objects of certain types, so-called implicit-lifetime types, if introduction of such objects would cause a program with otherwise undefined behavior to have defined behavior. See [intro.object]/10.
The draft now further states that if there are multiple sets of such objects that could be created implicitly to give the program defined behavior, it is unspecified which of these sets is created. (The relevant sentence does not seem to be present in the last proposal revision that I could access, R5, but is in the draft commit.)
Is there actually a program for which this choice of implicitly created object set is observable? In other words, is there a program with defined, but unspecified, behavior through this new rule, such that it is possible to infer from the output which sets of types of implicit objects (out of more than one possible one) were created?
Or was this sentence merely meant to clarify the program execution on the abstract machine (without observable impact)?