Skip to content

Commit 863a4c2

Browse files
burblebeetkoeppe
authored andcommitted
LWG3753 Clarify entity vs. freestanding entity
Fixes NB GB 075 (C++23 CD).
1 parent 7583485 commit 863a4c2

File tree

2 files changed

+47
-28
lines changed

2 files changed

+47
-28
lines changed

source/lib-intro.tex

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -914,52 +914,70 @@
914914
\pnum
915915
An implementation may use any technique that provides equivalent observable behavior.
916916

917-
\rSec3[freestanding.entity]{Freestanding entities}
917+
\rSec3[freestanding.item]{Freestanding items}
918918

919919
\pnum
920-
\indextext{entity!freestanding|see{freestanding entity}}%
921-
A \defn{freestanding entity} is a declaration or macro definition
922-
that is present in a freestanding implementation and a hosted implementation.
920+
\indextext{item!freestanding|see{freestanding item}}%
921+
A \defn{freestanding item} is
922+
a declaration, entity, \grammarterm{typedef-name}, or macro
923+
that is required to be present in
924+
a freestanding implementation and a hosted implementation.
923925

924926
\pnum
925927
Unless otherwise specified,
926-
the requirements on freestanding entities on a freestanding implementation
927-
are the same as the corresponding requirements in a hosted implementation.
928+
the requirements on freestanding items for a freestanding implementation
929+
are the same as the corresponding requirements for a hosted implementation,
930+
except that not all of the members of the namespaces are required to be present.
931+
\begin{note}
932+
This implies that freestanding item enumerations have the same enumerators on
933+
freestanding implementations and hosted implementations.
934+
Furthermore, class types have the same members and
935+
class templates have the same deduction guides
936+
on freestanding implementations and hosted implementations.
937+
\end{note}
938+
939+
\pnum
940+
\indextext{declaration!freestanding item}%
941+
A declaration in a header synopsis is a freestanding item if
942+
\begin{itemize}
943+
\item it is followed by a comment that includes \textit{freestanding}, or
944+
\item the header synopsis begins with a comment that includes \textit{all freestanding}.
945+
\end{itemize}
946+
947+
\pnum
948+
\indextext{entity!freestanding item}%
949+
\indextext{\idxgram{typedef-name}!freestanding item}%
950+
An entity or \grammarterm{typedef-name} is a freestanding item if it is:
951+
\begin{itemize}
952+
\item introduced by a declaration that is a freestanding item,
953+
\item an enclosing namespace of a freestanding item,
954+
\item a friend of a freestanding item,
955+
\item denoted by a \grammarterm{typedef-name} that is a freestanding item, or
956+
\item denoted by an alias template that is a freestanding item.
957+
\end{itemize}
958+
959+
\pnum
960+
\indextext{macro!freestanding item}%
961+
A macro is a freestanding item if it is defined in a header synopsis and
962+
\begin{itemize}
963+
\item the definition is followed by a comment that includes \textit{freestanding}, or
964+
\item the header synopsis begins with a comment that includes \textit{all freestanding}.
965+
\end{itemize}
928966

929967
\pnum
930-
In a header synopsis, entities followed with a comment
931-
that includes \textit{freestanding} are freestanding entities.
932968
\begin{example}
933969
\begin{codeblock}
934970
#define NULL @\seebelow@ // freestanding
935971
\end{codeblock}
936972
\end{example}
937973

938-
\pnum
939-
If a header synopsis begins with a comment
940-
that includes \textit{all freestanding},
941-
then all of the declarations and macro definitions in the header synopsis
942-
are freestanding entities.
943974
\begin{example}
944975
\begin{codeblock}
945976
// all freestanding
946977
namespace std {
947978
\end{codeblock}
948979
\end{example}
949980

950-
\pnum
951-
Deduction guides for freestanding entity class templates are freestanding entities.
952-
953-
\pnum
954-
Enclosing namespaces of freestanding entities are freestanding entities.
955-
956-
\pnum
957-
Friends of freestanding entities are freestanding entities.
958-
959-
\pnum
960-
Entities denoted by freestanding entity \grammarterm{typedef-name}{s} and
961-
freestanding entity alias templates are freestanding entities.
962-
963981
\rSec1[requirements]{Library-wide requirements}
964982

965983
\rSec2[requirements.general]{General}
@@ -1480,7 +1498,7 @@
14801498
\pnum
14811499
For each of the headers listed in \tref{headers.cpp.fs},
14821500
a freestanding implementation provides at least
1483-
the freestanding entities\iref{freestanding.entity} declared in the header.
1501+
the freestanding items\iref{freestanding.item} declared in the header.
14841502
\indextext{implementation!freestanding|)}%
14851503

14861504
\pnum

source/utilities.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11833,7 +11833,8 @@
1183311833
\indextext{function object!binders|)}
1183411834

1183511835
\pnum
11836-
Placeholders are freestanding entities\iref{freestanding.entity}.
11836+
\indextext{placeholders!freestanding item}%
11837+
Placeholders are freestanding items\iref{freestanding.item}.
1183711838

1183811839
\rSec2[func.memfn]{Function template \tcode{mem_fn}}%
1183911840
\indextext{function object!\idxcode{mem_fn}|(}

0 commit comments

Comments
 (0)