This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-01-13


2940. Definition of "object"

Section: 6.7.2  [intro.object]     Status: review     Submitter: Roman Jasmann     Date: 2024-09-22

Prior to P0137R1, the term "object" was defined to be "a region of storage". Currently, the term "object" appears to be missing a definition. The submitter suggests to restore wording similar to "An object is a region of storage that is occupied or released, associated with an object type and certain properties." and disagrees with the resolutions suggested below.

Possible resolution (option 1) [SUPERSEDED]:

Change in 6.7.2 [intro.object] paragraph 1 as follows:

An object is a logical element of the execution model of the abstract machine (4.1.2 [intro.abstract]). The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object object is created by a definition (6.2 [basic.def]), by a new-expression (7.6.2.8 [expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union (11.5 [class.union]), or when a temporary object is created (7.3.5 [conv.rval], 6.7.7 [class.temporary]). An object occupies a region of storage in its period of construction (11.9.5 [class.cdtor]), throughout its lifetime (6.7.4 [basic.life]), and in its period of destruction (11.9.5 [class.cdtor]). [Note 1: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note]

Possible resolution (option 2) [SUPERSEDED]:

Change in 6.7.2 [intro.object] paragraph 1 as follows:

An object is an element of the execution representation of the program in the abstract machine (4.1.2 [intro.abstract]) that represents an instance of an object type. The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object object is created by a definition (6.2 [basic.def]), by a new-expression (7.6.2.8 [expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union (11.5 [class.union]), or when a temporary object is created (7.3.5 [conv.rval], 6.7.7 [class.temporary]). An object occupies a region of storage in its period of construction (11.9.5 [class.cdtor]), throughout its lifetime (6.7.4 [basic.life]), and in its period of destruction (11.9.5 [class.cdtor]). [Note 1: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note]

CWG 2024-11-08

An alternative phrasing was suggested.

Update 2025-01-13: The submitter of the issue conveys his agreement with this phrasing.

Possible resolution:

Change in 6.7.2 [intro.object] paragraph 1 as follows:

An object is a logical unit of data that occupies storage in the abstract machine (4.1.2 [intro.abstract]). The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object object is created by a definition (6.2 [basic.def]), by a new-expression (7.6.2.8 [expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union (11.5 [class.union]), or when a temporary object is created (7.3.5 [conv.rval], 6.7.7 [class.temporary]). An object occupies a region of storage in its period of construction (11.9.5 [class.cdtor]), throughout its lifetime (6.7.4 [basic.life]), and in its period of destruction (11.9.5 [class.cdtor]). [Note 1: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note]