Skip to content

Commit ae92518

Browse files
committed
[basic.pre] Defragment specification of names and entities
The current contents of [basic.pre] jump between specifying different things. This PR moves all the specification of names to the front, followed by the specification of entities. There are two main benefits: (1) the specification for when two names are the same is a list of 4 rules that correspond to the 4 things than can form a name --- the connection is much clearer when the paragraphs are adjacent and the list is sorted to the same order; (2) in this form, even though all the words are the same, the reordering and merging of paragraphs a fit on a single page. The very last paragraph was forced over a page-break in the original layout.
1 parent 15b7ea6 commit ae92518

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

source/basic.tex

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,22 @@
3232
\indextext{storage class}%
3333
\indextext{scope}%
3434
\indextext{linkage}%
35-
An \defn{entity} is a value, object, reference,
36-
structured binding,
37-
function, enumerator, type,
38-
class member, bit-field, template, template specialization, namespace, or
39-
pack.
40-
41-
\pnum
4235
A \defn{name} is an \grammarterm{identifier}\iref{lex.name},
4336
\grammarterm{operator-function-id}\iref{over.oper},
4437
\grammarterm{literal-operator-id}\iref{over.literal}, or
4538
\grammarterm{conversion-function-id}\iref{class.conv.fct}.
4639

40+
\pnum
41+
Two names are \defnx{the same}{name!same} if
42+
\begin{itemize}
43+
\item they are \grammarterm{identifier}{s} composed of the same character sequence, or
44+
\item they are \grammarterm{operator-function-id}{s} formed with the same operator, or
45+
\item they are \grammarterm{literal-operator-id}{s} formed with the same
46+
literal suffix identifier, or
47+
\item they are \grammarterm{conversion-function-id}{s} formed with
48+
equivalent\iref{temp.over.link} types.
49+
\end{itemize}
50+
4751
\pnum
4852
Every name is introduced by a \defn{declaration}, which is a
4953
\begin{itemize}
@@ -85,42 +89,34 @@
8589
The interpretation of a \grammarterm{for-range-declaration} produces
8690
one or more of the above\iref{stmt.ranged}.
8791
\end{note}
88-
An entity $E$ is denoted by the name (if any)
89-
that is introduced by a declaration of $E$ or
90-
by a \grammarterm{typedef-name} introduced by a declaration specifying $E$.
92+
93+
\pnum
94+
Some names denote types or templates. In general, whenever a name is
95+
encountered it is necessary to determine whether that name denotes one of these
96+
entities before continuing to parse the program that contains it. The process
97+
that determines this is called
98+
\defnx{name lookup}{lookup!name}\iref{basic.lookup}.
9199

92100
\pnum
93101
A \defn{variable} is introduced by the
94102
declaration of
95103
a reference other than a non-static data member or of
96104
an object. The variable's name, if any, denotes the reference or object.
97105

106+
\pnum
107+
An \defn{entity} is a value, object, reference, structured binding, function,
108+
enumerator, type, class member, bit-field, template, template specialization,
109+
namespace, or pack. An entity $E$ is denoted by the name (if any) that is
110+
introduced by a declaration of $E$ or by a \grammarterm{typedef-name}
111+
introduced by a declaration specifying $E$.
112+
98113
\pnum
99114
A \defnadj{local}{entity} is a variable with
100115
automatic storage duration\iref{basic.stc.auto},
101116
a structured binding\iref{dcl.struct.bind}
102117
whose corresponding variable is such an entity,
103118
or the \tcode{*\keyword{this}} object\iref{expr.prim.this}.
104119

105-
\pnum
106-
Some names denote types or templates. In general,
107-
whenever a name is encountered it is necessary to determine whether that name denotes
108-
one of these entities before continuing to parse the program that contains it. The
109-
process that determines this is called
110-
\defnx{name lookup}{lookup!name}\iref{basic.lookup}.
111-
112-
\pnum
113-
Two names are \defnx{the same}{name!same} if
114-
\begin{itemize}
115-
\item they are \grammarterm{identifier}{s} composed of the same character sequence, or
116-
\item they are \grammarterm{operator-function-id}{s} formed with
117-
the same operator, or
118-
\item they are \grammarterm{conversion-function-id}{s} formed
119-
with equivalent\iref{temp.over.link} types, or
120-
\item they are \grammarterm{literal-operator-id}{s}\iref{over.literal} formed with
121-
the same literal suffix identifier.
122-
\end{itemize}
123-
124120
\pnum
125121
\indextext{translation unit!name and}%
126122
\indextext{linkage}%

0 commit comments

Comments
 (0)