Under [basic.stc.general], clause 1 writes:The storage duration is the property of an object that defines the minimum potential lifetime of the storage containing the object. The storage duration is determined by the construct used to create the object and is one of the following [four categories omitted].So it apparently covers all kinds of objects, including temporary objects.
Although clause 2 mentions temporary objects (an improvement over published standards), none of the categories seems to fit temporaries. Where [class.temporary] mentions storage durations, it is about the destruction order. E.g.:if obj1 is an object with the same storage duration as the temporary and created before the temporary is created the temporary shall be destroyed before obj1 is destroyedThe good side is that it strengthens the idea that a temporary object should have a storage duration, and even that it should be one of the defined storage durations. However, if the temporary is not lifetime-extended, the automatic storage duration does not really fit—[basic.stc.auto] only describes variables and scopes (as vs unnamed objects and full-expressions).
So my feeling is that the standard is already trying to reconcile an inconsistency in its language, but has not yet fully done so.
--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion