From Jason Turner

[lex.ext]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_ep8ln91/{from.md → to.md} +29 -49
tmp/tmp_ep8ln91/{from.md → to.md} RENAMED
@@ -55,14 +55,13 @@ The syntactic non-terminal preceding the *ud-suffix* in a
55
  that could match that non-terminal.
56
 
57
  A *user-defined-literal* is treated as a call to a literal operator or
58
  literal operator template [[over.literal]]. To determine the form of
59
  this call for a given *user-defined-literal* *L* with *ud-suffix* *X*,
60
- the *literal-operator-id* whose literal suffix identifier is *X* is
61
- looked up in the context of *L* using the rules for unqualified name
62
- lookup [[basic.lookup.unqual]]. Let *S* be the set of declarations found
63
- by this lookup. *S* shall not be empty.
64
 
65
  If *L* is a *user-defined-integer-literal*, let *n* be the literal
66
  without its *ud-suffix*. If *S* contains a literal operator with
67
  parameter type `unsigned long long`, the literal *L* is treated as a
68
  call of the form
@@ -74,11 +73,11 @@ operator "" X(nULL)
74
  Otherwise, *S* shall contain a raw literal operator or a numeric literal
75
  operator template [[over.literal]] but not both. If *S* contains a raw
76
  literal operator, the literal *L* is treated as a call of the form
77
 
78
  ``` cpp
79
- operator "" X("n{"})
80
  ```
81
 
82
  Otherwise (*S* contains a numeric literal operator template), *L* is
83
  treated as a call of the form
84
 
@@ -87,11 +86,11 @@ operator "" X<'c₁', 'c₂', ... 'cₖ'>()
87
  ```
88
 
89
  where *n* is the source character sequence c₁c₂...cₖ.
90
 
91
  [*Note 1*: The sequence c₁c₂...cₖ can only contain characters from the
92
- basic source character set. — *end note*]
93
 
94
  If *L* is a *user-defined-floating-point-literal*, let *f* be the
95
  literal without its *ud-suffix*. If *S* contains a literal operator with
96
  parameter type `long double`, the literal *L* is treated as a call of
97
  the form
@@ -103,11 +102,11 @@ operator "" X(fL)
103
  Otherwise, *S* shall contain a raw literal operator or a numeric literal
104
  operator template [[over.literal]] but not both. If *S* contains a raw
105
  literal operator, the *literal* *L* is treated as a call of the form
106
 
107
  ``` cpp
108
- operator "" X("f{"})
109
  ```
110
 
111
  Otherwise (*S* contains a numeric literal operator template), *L* is
112
  treated as a call of the form
113
 
@@ -116,11 +115,11 @@ operator "" X<'c₁', 'c₂', ... 'cₖ'>()
116
  ```
117
 
118
  where *f* is the source character sequence c₁c₂...cₖ.
119
 
120
  [*Note 2*: The sequence c₁c₂...cₖ can only contain characters from the
121
- basic source character set. — *end note*]
122
 
123
  If *L* is a *user-defined-string-literal*, let *str* be the literal
124
  without its *ud-suffix* and let *len* be the number of code units in
125
  *str* (i.e., its length excluding the terminating null character). If
126
  *S* contains a literal operator template with a non-type template
@@ -174,39 +173,43 @@ suffix is applied to the result of the concatenation.
174
 
175
  [*Example 3*:
176
 
177
  ``` cpp
178
  int main() {
179
- L"A" "B" "C"_x; // OK: same as L"ABC"_x
180
  "P"_x "Q" "R"_y; // error: two different ud-suffix{es}
181
  }
182
  ```
183
 
184
  — *end example*]
185
 
186
  <!-- Link reference definitions -->
 
187
  [basic.fundamental]: basic.md#basic.fundamental
188
  [basic.link]: basic.md#basic.link
189
  [basic.lookup.unqual]: basic.md#basic.lookup.unqual
190
  [basic.stc]: basic.md#basic.stc
191
- [basic.types]: basic.md#basic.types
192
  [conv.mem]: expr.md#conv.mem
193
  [conv.ptr]: expr.md#conv.ptr
194
  [cpp]: cpp.md#cpp
195
- [cpp.concat]: cpp.md#cpp.concat
196
  [cpp.cond]: cpp.md#cpp.cond
197
  [cpp.import]: cpp.md#cpp.import
198
  [cpp.include]: cpp.md#cpp.include
199
  [cpp.module]: cpp.md#cpp.module
200
  [cpp.stringize]: cpp.md#cpp.stringize
201
  [dcl.attr.grammar]: dcl.md#dcl.attr.grammar
 
202
  [headers]: library.md#headers
203
  [lex]: #lex
204
  [lex.bool]: #lex.bool
205
  [lex.ccon]: #lex.ccon
206
  [lex.ccon.esc]: #lex.ccon.esc
 
207
  [lex.charset]: #lex.charset
 
 
208
  [lex.comment]: #lex.comment
209
  [lex.digraph]: #lex.digraph
210
  [lex.ext]: #lex.ext
211
  [lex.fcon]: #lex.fcon
212
  [lex.fcon.type]: #lex.fcon.type
@@ -217,83 +220,60 @@ int main() {
217
  [lex.key]: #lex.key
218
  [lex.key.digraph]: #lex.key.digraph
219
  [lex.literal]: #lex.literal
220
  [lex.literal.kinds]: #lex.literal.kinds
221
  [lex.name]: #lex.name
222
- [lex.name.allowed]: #lex.name.allowed
223
- [lex.name.disallowed]: #lex.name.disallowed
224
  [lex.name.special]: #lex.name.special
225
  [lex.nullptr]: #lex.nullptr
226
  [lex.operators]: #lex.operators
227
  [lex.phases]: #lex.phases
228
  [lex.ppnumber]: #lex.ppnumber
229
  [lex.pptoken]: #lex.pptoken
230
  [lex.separate]: #lex.separate
231
  [lex.string]: #lex.string
232
  [lex.string.concat]: #lex.string.concat
 
233
  [lex.token]: #lex.token
234
  [module.import]: module.md#module.import
235
  [module.unit]: module.md#module.unit
236
  [over.literal]: over.md#over.literal
 
237
  [temp.explicit]: temp.md#temp.explicit
238
  [temp.names]: temp.md#temp.names
239
 
240
- [^1]: Implementations must behave as if these separate phases occur,
241
- although in practice different phases might be folded together.
242
 
243
  [^2]: A partial preprocessing token would arise from a source file
244
  ending in the first portion of a multi-character token that requires
245
  a terminating sequence of characters, such as a *header-name* that
246
  is missing the closing `"` or `>`. A partial comment would arise
247
  from a source file ending with an unclosed `/*` comment.
248
 
249
- [^3]: An implementation need not convert all non-corresponding source
250
- characters to the same execution character.
251
-
252
- [^4]: The glyphs for the members of the basic source character set are
253
- intended to identify characters from the subset of ISO/IEC 10646
254
- which corresponds to the ASCII character set. However, because the
255
- mapping from source file characters to the source character set
256
- (described in translation phase 1) is specified as
257
- *implementation-defined*, an implementation is required to document
258
- how the basic source characters are represented in source files.
259
-
260
- [^5]: A sequence of characters resembling a *universal-character-name*
261
- in an *r-char-sequence* [[lex.string]] does not form a
262
- *universal-character-name*.
263
-
264
- [^6]: These include “digraphs” and additional reserved words. The term
265
  “digraph” (token consisting of two characters) is not perfectly
266
  descriptive, since one of the alternative *preprocessing-token*s is
267
  `%:%:` and of course several primary tokens contain two characters.
268
  Nonetheless, those alternative tokens that aren’t lexical keywords
269
  are colloquially known as “digraphs”.
270
 
271
- [^7]: Thus the “stringized” values [[cpp.stringize]] of `[` and `<:`
272
  will be different, maintaining the source spelling, but the tokens
273
  can otherwise be freely interchanged.
274
 
275
- [^8]: Literals include strings and character and numeric literals.
276
 
277
- [^9]: Thus, a sequence of characters that resembles an escape sequence
278
- might result in an error, be interpreted as the character
279
  corresponding to the escape sequence, or have a completely different
280
  meaning, depending on the implementation.
281
 
282
- [^10]: On systems in which linkers cannot accept extended characters, an
283
- encoding of the *universal-character-name* may be used in forming
284
  valid external identifiers. For example, some otherwise unused
285
- character or sequence of characters may be used to encode the `\u`
286
- in a *universal-character-name*. Extended characters may produce a
287
  long external identifier, but C++ does not place a translation limit
288
- on significant characters for external identifiers. In C++, upper-
289
- and lower-case letters are considered different for all identifiers,
290
- including external identifiers.
291
 
292
- [^11]: The term “literal” generally designates, in this document, those
293
  tokens that are called “constants” in ISO C.
294
-
295
- [^12]: They are intended for character sets where a character does not
296
- fit into a single byte.
297
-
298
- [^13]: Using an escape sequence for a question mark is supported for
299
- compatibility with ISO C++14 and ISO C.
 
55
  that could match that non-terminal.
56
 
57
  A *user-defined-literal* is treated as a call to a literal operator or
58
  literal operator template [[over.literal]]. To determine the form of
59
  this call for a given *user-defined-literal* *L* with *ud-suffix* *X*,
60
+ first let *S* be the set of declarations found by unqualified lookup for
61
+ the *literal-operator-id* whose literal suffix identifier is *X*
62
+ [[basic.lookup.unqual]]. *S* shall not be empty.
 
63
 
64
  If *L* is a *user-defined-integer-literal*, let *n* be the literal
65
  without its *ud-suffix*. If *S* contains a literal operator with
66
  parameter type `unsigned long long`, the literal *L* is treated as a
67
  call of the form
 
73
  Otherwise, *S* shall contain a raw literal operator or a numeric literal
74
  operator template [[over.literal]] but not both. If *S* contains a raw
75
  literal operator, the literal *L* is treated as a call of the form
76
 
77
  ``` cpp
78
+ operator ""X("n")
79
  ```
80
 
81
  Otherwise (*S* contains a numeric literal operator template), *L* is
82
  treated as a call of the form
83
 
 
86
  ```
87
 
88
  where *n* is the source character sequence c₁c₂...cₖ.
89
 
90
  [*Note 1*: The sequence c₁c₂...cₖ can only contain characters from the
91
+ basic character set. — *end note*]
92
 
93
  If *L* is a *user-defined-floating-point-literal*, let *f* be the
94
  literal without its *ud-suffix*. If *S* contains a literal operator with
95
  parameter type `long double`, the literal *L* is treated as a call of
96
  the form
 
102
  Otherwise, *S* shall contain a raw literal operator or a numeric literal
103
  operator template [[over.literal]] but not both. If *S* contains a raw
104
  literal operator, the *literal* *L* is treated as a call of the form
105
 
106
  ``` cpp
107
+ operator ""X("f")
108
  ```
109
 
110
  Otherwise (*S* contains a numeric literal operator template), *L* is
111
  treated as a call of the form
112
 
 
115
  ```
116
 
117
  where *f* is the source character sequence c₁c₂...cₖ.
118
 
119
  [*Note 2*: The sequence c₁c₂...cₖ can only contain characters from the
120
+ basic character set. — *end note*]
121
 
122
  If *L* is a *user-defined-string-literal*, let *str* be the literal
123
  without its *ud-suffix* and let *len* be the number of code units in
124
  *str* (i.e., its length excluding the terminating null character). If
125
  *S* contains a literal operator template with a non-type template
 
173
 
174
  [*Example 3*:
175
 
176
  ``` cpp
177
  int main() {
178
+ L"A" "B" "C"_x; // OK, same as L"ABC"_x
179
  "P"_x "Q" "R"_y; // error: two different ud-suffix{es}
180
  }
181
  ```
182
 
183
  — *end example*]
184
 
185
  <!-- Link reference definitions -->
186
+ [basic.extended.fp]: basic.md#basic.extended.fp
187
  [basic.fundamental]: basic.md#basic.fundamental
188
  [basic.link]: basic.md#basic.link
189
  [basic.lookup.unqual]: basic.md#basic.lookup.unqual
190
  [basic.stc]: basic.md#basic.stc
191
+ [character.seq]: library.md#character.seq
192
  [conv.mem]: expr.md#conv.mem
193
  [conv.ptr]: expr.md#conv.ptr
194
  [cpp]: cpp.md#cpp
 
195
  [cpp.cond]: cpp.md#cpp.cond
196
  [cpp.import]: cpp.md#cpp.import
197
  [cpp.include]: cpp.md#cpp.include
198
  [cpp.module]: cpp.md#cpp.module
199
  [cpp.stringize]: cpp.md#cpp.stringize
200
  [dcl.attr.grammar]: dcl.md#dcl.attr.grammar
201
+ [expr.prim.literal]: expr.md#expr.prim.literal
202
  [headers]: library.md#headers
203
  [lex]: #lex
204
  [lex.bool]: #lex.bool
205
  [lex.ccon]: #lex.ccon
206
  [lex.ccon.esc]: #lex.ccon.esc
207
+ [lex.ccon.literal]: #lex.ccon.literal
208
  [lex.charset]: #lex.charset
209
+ [lex.charset.basic]: #lex.charset.basic
210
+ [lex.charset.literal]: #lex.charset.literal
211
  [lex.comment]: #lex.comment
212
  [lex.digraph]: #lex.digraph
213
  [lex.ext]: #lex.ext
214
  [lex.fcon]: #lex.fcon
215
  [lex.fcon.type]: #lex.fcon.type
 
220
  [lex.key]: #lex.key
221
  [lex.key.digraph]: #lex.key.digraph
222
  [lex.literal]: #lex.literal
223
  [lex.literal.kinds]: #lex.literal.kinds
224
  [lex.name]: #lex.name
 
 
225
  [lex.name.special]: #lex.name.special
226
  [lex.nullptr]: #lex.nullptr
227
  [lex.operators]: #lex.operators
228
  [lex.phases]: #lex.phases
229
  [lex.ppnumber]: #lex.ppnumber
230
  [lex.pptoken]: #lex.pptoken
231
  [lex.separate]: #lex.separate
232
  [lex.string]: #lex.string
233
  [lex.string.concat]: #lex.string.concat
234
+ [lex.string.literal]: #lex.string.literal
235
  [lex.token]: #lex.token
236
  [module.import]: module.md#module.import
237
  [module.unit]: module.md#module.unit
238
  [over.literal]: over.md#over.literal
239
+ [support.types.layout]: support.md#support.types.layout
240
  [temp.explicit]: temp.md#temp.explicit
241
  [temp.names]: temp.md#temp.names
242
 
243
+ [^1]: Implementations behave as if these separate phases occur, although
244
+ in practice different phases can be folded together.
245
 
246
  [^2]: A partial preprocessing token would arise from a source file
247
  ending in the first portion of a multi-character token that requires
248
  a terminating sequence of characters, such as a *header-name* that
249
  is missing the closing `"` or `>`. A partial comment would arise
250
  from a source file ending with an unclosed `/*` comment.
251
 
252
+ [^3]: These include “digraphs” and additional reserved words. The term
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  “digraph” (token consisting of two characters) is not perfectly
254
  descriptive, since one of the alternative *preprocessing-token*s is
255
  `%:%:` and of course several primary tokens contain two characters.
256
  Nonetheless, those alternative tokens that aren’t lexical keywords
257
  are colloquially known as “digraphs”.
258
 
259
+ [^4]: Thus the “stringized” values [[cpp.stringize]] of `[` and `<:`
260
  will be different, maintaining the source spelling, but the tokens
261
  can otherwise be freely interchanged.
262
 
263
+ [^5]: Literals include strings and character and numeric literals.
264
 
265
+ [^6]: Thus, a sequence of characters that resembles an escape sequence
266
+ can result in an error, be interpreted as the character
267
  corresponding to the escape sequence, or have a completely different
268
  meaning, depending on the implementation.
269
 
270
+ [^7]: On systems in which linkers cannot accept extended characters, an
271
+ encoding of the \*universal-character-name\* can be used in forming
272
  valid external identifiers. For example, some otherwise unused
273
+ character or sequence of characters can be used to encode the `̆` in
274
+ a \*universal-character-name\*. Extended characters can produce a
275
  long external identifier, but C++ does not place a translation limit
276
+ on significant characters for external identifiers.
 
 
277
 
278
+ [^8]: The term “literal” generally designates, in this document, those
279
  tokens that are called “constants” in ISO C.