|
4 | 4 | \gramSec[gram.basic]{Basics}
|
5 | 5 |
|
6 | 6 | \rSec1[basic.pre]{Preamble}
|
| 7 | +\indextext{type}% |
| 8 | +\indextext{object}% |
| 9 | +\indextext{storage class}% |
| 10 | +\indextext{scope}% |
| 11 | +\indextext{linkage}% |
7 | 12 |
|
8 | 13 | \pnum
|
9 | 14 | \begin{note}
|
|
27 | 32 | \end{note}
|
28 | 33 |
|
29 | 34 | \pnum
|
30 |
| -\indextext{type}% |
31 |
| -\indextext{object}% |
32 |
| -\indextext{storage class}% |
33 |
| -\indextext{scope}% |
34 |
| -\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. |
| 35 | +A \defn{name} is an \grammarterm{identifier}\iref{lex.name}, |
| 36 | +\grammarterm{conversion-function-id}\iref{class.conv.fct}, |
| 37 | +\grammarterm{operator-function-id}\iref{over.oper}, or |
| 38 | +\grammarterm{literal-operator-id}\iref{over.literal}. |
40 | 39 |
|
41 | 40 | \pnum
|
42 |
| -A \defn{name} is an \grammarterm{identifier}\iref{lex.name}, |
43 |
| -\grammarterm{operator-function-id}\iref{over.oper}, |
44 |
| -\grammarterm{literal-operator-id}\iref{over.literal}, or |
45 |
| -\grammarterm{conversion-function-id}\iref{class.conv.fct}. |
| 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{conversion-function-id}{s} formed with |
| 45 | +equivalent\iref{temp.over.link} types, or |
| 46 | +\item they are \grammarterm{operator-function-id}{s} formed with |
| 47 | +the same operator, or |
| 48 | +\item they are \grammarterm{literal-operator-id}{s} formed with |
| 49 | +the same literal suffix identifier. |
| 50 | +\end{itemize} |
46 | 51 |
|
47 | 52 | \pnum
|
48 | 53 | Every name is introduced by a \defn{declaration}, which is a
|
|
85 | 90 | The interpretation of a \grammarterm{for-range-declaration} produces
|
86 | 91 | one or more of the above\iref{stmt.ranged}.
|
87 | 92 | \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$. |
| 93 | + |
| 94 | +\pnum |
| 95 | +\begin{note} |
| 96 | +Some names denote types or templates. |
| 97 | +In general, whenever a name is encountered |
| 98 | +it is necessary to look it up\iref{basic.lookup} |
| 99 | +to determine whether that name denotes one of these entities |
| 100 | +before continuing to parse the program that contains it. |
| 101 | +\end{note} |
91 | 102 |
|
92 | 103 | \pnum
|
93 | 104 | A \defn{variable} is introduced by the
|
94 | 105 | declaration of
|
95 | 106 | a reference other than a non-static data member or of
|
96 | 107 | an object. The variable's name, if any, denotes the reference or object.
|
97 | 108 |
|
| 109 | +\pnum |
| 110 | +An \defn{entity} is a value, object, reference, |
| 111 | +structured binding, |
| 112 | +function, enumerator, type, |
| 113 | +class member, bit-field, template, template specialization, namespace, or |
| 114 | +pack. An entity $E$ is denoted by the name (if any) |
| 115 | +that is introduced by a declaration of $E$ or |
| 116 | +by a \grammarterm{typedef-name} introduced by a declaration specifying $E$. |
| 117 | + |
98 | 118 | \pnum
|
99 | 119 | A \defnadj{local}{entity} is a variable with
|
100 | 120 | automatic storage duration\iref{basic.stc.auto},
|
101 | 121 | a structured binding\iref{dcl.struct.bind}
|
102 | 122 | whose corresponding variable is such an entity,
|
103 | 123 | or the \tcode{*\keyword{this}} object\iref{expr.prim.this}.
|
104 | 124 |
|
105 |
| -\pnum |
106 |
| -\begin{note} |
107 |
| -Some names denote types or templates. |
108 |
| -In general, whenever a name is encountered |
109 |
| -it is necessary to look it up\iref{basic.lookup} |
110 |
| -to determine whether that name denotes one of these entities |
111 |
| -before continuing to parse the program that contains it. |
112 |
| -\end{note} |
113 |
| - |
114 |
| -\pnum |
115 |
| -Two names are \defnx{the same}{name!same} if |
116 |
| -\begin{itemize} |
117 |
| -\item they are \grammarterm{identifier}{s} composed of the same character sequence, or |
118 |
| -\item they are \grammarterm{operator-function-id}{s} formed with |
119 |
| -the same operator, or |
120 |
| -\item they are \grammarterm{conversion-function-id}{s} formed |
121 |
| -with equivalent\iref{temp.over.link} types, or |
122 |
| -\item they are \grammarterm{literal-operator-id}{s}\iref{over.literal} formed with |
123 |
| -the same literal suffix identifier. |
124 |
| -\end{itemize} |
125 |
| - |
126 | 125 | \pnum
|
127 | 126 | \indextext{translation unit!name and}%
|
128 | 127 | \indextext{linkage}%
|
|
0 commit comments