Section: 16.3.3.6 [freestanding.item] Status: C++23 Submitter: Ben Craig Opened: 2022-08-23 Last modified: 2023-11-22
Priority: 2
View all other issues in [freestanding.item].
View all issues with C++23 status.
Discussion:
This addresses NB comment GB-075 ( [freeestanding.entity] "Freestanding entities" are not entities)
[freestanding.entity] p1 defines a freestanding entity as a declaration or macro definition.
[freestanding.entity] p3 then says "entities followed with a comment […] are freestanding entities".
This is inconsistent, and breaks with macros, because macros are not entities, but they can be freestanding entities.
[2022-09-23; Reflector poll]
Set priority to 2 after reflector poll.
It's confusing for "freestanding entities" to be two things, neither of which are entities. Declarations may declare entities, they are not entities themselves. Given this definition, p6/7/8 makes no sense. A namespace can't be a freestanding entity since it's neither a declaration nor a macro definition.
"freestanding entities" is not best name, given the collision with core entity, but I think that this is separable issue.
[2022-09-28; Reflector poll]
Set status to Tentatively Ready after five votes in favour during reflector poll.
Previous resolution [SUPERSEDED]:
This wording is relative to the forthcoming C++23 CD.
Modify [freestanding.entity] as indicated:
-3- In a header synopsis,entitiesdeclarations and macro definitions followed with a comment that includes freestanding are freestanding entities.
[2022-11-06; Ben Craig provides new wording]
[2022-11-07; Kona - move to open]
New proposed resolution to be added.
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [freestanding.entity] as indicated:
[Drafting note: Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
16.3.3.6 Freestanding
-1- A freestandingentitiesitems [freestanding.itementity]entityitem isa declarationan entity or macro definition that is present in a freestanding implementation and a hosted implementation. -2- Unless otherwise specified, the requirements on freestandingentitiesitems on a freestanding implementation are the same as the corresponding requirements in a hosted implementation. -3- In a header synopsis, entities introduced by declarations followed with a comment that includes freestanding are freestandingentitiesitems. -?- In a header synopsis, macro definitions followed with a comment that includes freestanding are freestanding items. […] -4- If a header synopsis begins with a comment that includes all freestanding, then all of the entities introduced by declarationsand macro definitionsin the header synopsis are freestandingentitiesitems. -?- If a header synopsis begins with a comment that includes all freestanding, then all of the macro definitions in the header synopsis are freestanding items. […] -5- Deduction guides for freestandingentityitem class templates are freestandingentitiesitems. -6- Enclosing namespaces of freestandingentitiesitems are freestandingentitiesitems. -7- Friends of freestandingentitiesitems are freestandingentitiesitems. -8- Entities denoted by freestandingentityitem typedef-names and freestandingentityitem alias templates are freestandingentitiesitems.Modify 16.4.2.5 [compliance] as indicated:
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
entitiesitems ( [freestanding.entity]) declared in the header.Modify 22.10.15.5 [func.bind.place] as indicated:
-3- Placeholders are freestanding
entitiesitems ( [freestanding.entity]).
[2022-11-08; Ben Craig provides improved wording]
This combined resolution addresses both 3753 and LWG 3815, and has already been reviewed by LWG.
This resolves ballot comment GB-75. It also partially addresses GB-130 (along with LWG 3814).
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify 16.3.3.6 [freestanding.entity] as indicated:
[Drafting note: Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
16.3.3.6 Freestanding
-1- A freestandingentitiesitems [freestanding.itementity]entityitem isa declarationan entity or macro definition that is present in a freestanding implementation and a hosted implementation. -2- Unless otherwise specified, the requirements on non-namespace freestandingentitiesitems on a freestanding implementation are the same as the corresponding requirements in a hosted implementation. [Note: Enumerators impose requirements on their enumerations. Freestanding item enumerations have the same enumerators on freestanding implementations and hosted implementations. Members and deduction guides impose requirements on their class types. Class types have the same deduction guides and members on freestanding implementations and hosted implementations. — end note] -3- In a header synopsis,entitieseach entity introduced by a declaration followedwithby a comment that includes freestandingareis a freestandingentitiesitem. -?- In a header synopsis, each macro definition followed by a comment that includes freestanding is a freestanding item. […] -4- If a header synopsis begins with a comment that includes all freestanding, thenall of the declarations and macro definitionseach entity introduced by a declaration in the header synopsisareis a freestandingentitiesitem. -?- If a header synopsis begins with a comment that includes all freestanding, then each macro definition in the header synopsis is a freestanding item. […]-5- Deduction guides for freestanding entity class templates are freestanding entities.-6-Enclosing namespaces of freestanding entities are freestanding entities.Each enclosing namespace of each freestanding item is a freestanding item. -7-Friends of freestanding entities are freestanding entities.Each friend of each freestanding item is a freestanding item. -8-Entities denoted by freestanding entity typedef-names and freestanding entity alias templates are freestanding entities.Each entity denoted by each freestanding item typedef-name and each freestanding item alias template is a freestanding item.Modify 16.4.2.5 [compliance] as indicated:
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]) declared in the header.Modify 22.10.15.5 [func.bind.place] as indicated:
-3- Placeholders are freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]).
[2022-11-09; Ben Craig and Tomasz provide improved wording]
This new resolution merges definition of freestanding item for entity in macro into bullet lists. It still addresses both 3753 and LWG 3815.
This resolves ballot comment GB-75. It also partially addresses GB-130 (along with LWG 3814).
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [freestanding.entity] as indicated:
[Drafting note: Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
16.3.3.6 Freestanding
-1- A freestandingentitiesitems [freestanding.itementity]entityitem isa declarationan entity or macro definition that is present in a freestanding implementation and a hosted implementation. -2- Unless otherwise specified, the requirements on freestandingentitiesitems, except namespaces,onfor a freestanding implementation are the same as the corresponding requirementsinfor a hosted implementation. [Note: This implies that freestanding item enumerations have the same enumerators on freestanding implementations and hosted implementations. Furthermore, class types have the same deduction guides and members on freestanding implementations and hosted implementations. — end note] -3- An entity is a freestanding item, if it is:-4- A macro definition is a freestanding item, if it is defined in the header synopsis and
(3.1) — introduced by a declaration in the header synopsis, and
(3.1.1) — the declaration is followed by a comment that includes freestanding, or
(3.1.2) — the header synopsis begins with a comment that includes all freestanding;
(3.2) — an enclosing namespace of a freestanding item,
(3.3) — a friend of a freestanding item,
(3.4) — denoted by a typedef-name, that is a freestanding item, or
(3.5) — denoted by a template alias, that is a freestanding item.
(4.1) — the definition is followed by a comment that includes freestanding in the header synopsis, or
(4.2) — the header synopsis begins with a comment that includes all freestanding.
-3- In a header synopsis, entities followed with a comment that includes freestanding are freestanding entities.[Example 1: … — end example]-4- If a header synopsis begins with a comment that includes all freestanding, then all of the declarations and macro definitions in the header synopsis are freestanding entities..[Example 2: … — end example]-5- Deduction guides for freestanding entity class templates are freestanding entities.-6- Enclosing namespaces of freestanding entities are freestanding entities.-7- Friends of freestanding entities are freestanding entities.-8- Entities denoted by freestanding entity typedef-names and freestanding entity alias templates are freestanding entities.Modify 16.4.2.5 [compliance] as indicated:
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]) declared in the header.Modify 22.10.15.5 [func.bind.place] as indicated:
-3- Placeholders are freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]).
[2022-11-10; Tomasz provide improved wording]
Updated wording to support freestanding typedef-names and using declaration that are not entities. It still addresses both 3753 and LWG 3815.
This resolves ballot comment GB-75. It also partially addresses GB-130 (along with LWG 3814).
[Kona 2022-11-10; Move to Immediate]
[2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Immediate → WP.]
Proposed resolution:
This wording is relative to N4917.
Modify [freestanding.entity] as indicated:
[Drafting note: Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
16.3.3.6 Freestanding
-1- A freestandingentitiesitems [freestanding.itementity]entityitem is a declaration, entity, typedef-name, or macrodefinitionthat is required to be present in a freestanding implementation and a hosted implementation. -2- Unless otherwise specified, the requirements on freestandingentitiesitemsonfor a freestanding implementation are the same as the corresponding requirementsinfor a hosted implementation, except that not all of the members of the namespaces are required to be present. [Note: This implies that freestanding item enumerations have the same enumerators on freestanding implementations and hosted implementations. Furthermore, class types have the same members and class templates have the same deduction guides on freestanding implementations and hosted implementations. — end note] -3- A declaration in a header synopsis is a freestanding item if-4- An entity or typedef-name is a freestanding item if it is:
(3.1) — it is followed by a comment that includes freestanding, or
(3.1) — the header synopsis begins with a comment that includes all freestanding.
-5- A macro is a freestanding item if it is defined in a header synopsis and
(4.1) — introduced by a declaration that is a freestanding item,
(4.2) — an enclosing namespace of a freestanding item,
(4.3) — a friend of a freestanding item,
(4.4) — denoted by a typedef-name that is a freestanding item, or
(4.5) — denoted by an alias template that is a freestanding item.
(5.1) — the definition is followed by a comment that includes freestanding, or
(5.2) — the header synopsis begins with a comment that includes all freestanding.
-3- In a header synopsis, entities followed with a comment that includes freestanding are freestanding entities.[Example 1: … — end example]-4- If a header synopsis begins with a comment that includes all freestanding, then all of the declarations and macro definitions in the header synopsis are freestanding entities..[Example 2: … — end example]-5- Deduction guides for freestanding entity class templates are freestanding entities.-6- Enclosing namespaces of freestanding entities are freestanding entities.-7- Friends of freestanding entities are freestanding entities.-8- Entities denoted by freestanding entity typedef-names and freestanding entity alias templates are freestanding entities.
Modify 16.4.2.5 [compliance] as indicated:
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]) declared in the header.
Modify 22.10.15.5 [func.bind.place] as indicated:
-3- Placeholders are freestanding
entitiesitems (16.3.3.6 [freestanding.entityitem]).