From Jason Turner

[intro]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmppbvy6g2f/{from.md → to.md} +59 -70
tmp/tmppbvy6g2f/{from.md → to.md} RENAMED
@@ -1,89 +1,103 @@
1
  # General principles <a id="intro">[[intro]]</a>
2
 
3
  ## Implementation compliance <a id="intro.compliance">[[intro.compliance]]</a>
4
 
 
 
5
  The set of *diagnosable rules* consists of all syntactic and semantic
6
  rules in this document except for those rules containing an explicit
7
  notation that “no diagnostic is required” or which are described as
8
  resulting in “undefined behavior”.
9
 
10
  Although this document states only requirements on C++ implementations,
11
  those requirements are often easier to understand if they are phrased as
12
  requirements on programs, parts of programs, or execution of programs.
13
  Such requirements have the following meaning:
14
 
15
- - If a program contains no violations of the rules in this document, a
16
- conforming implementation shall, within its resource limits, accept
17
- and correctly execute[^2] that program.
18
- - If a program contains a violation of any diagnosable rule or an
19
- occurrence of a construct described in this document as
20
- “conditionally-supported” when the implementation does not support
21
- that construct, a conforming implementation shall issue at least one
22
- diagnostic message.
23
  - If a program contains a violation of a rule for which no diagnostic is
24
  required, this document places no requirement on implementations with
25
  respect to that program.
 
 
 
 
 
26
 
27
  [*Note 1*: During template argument deduction and substitution, certain
28
  constructs that in other contexts require a diagnostic are treated
29
  differently; see  [[temp.deduct]]. — *end note*]
30
 
 
 
 
 
 
 
 
 
 
 
31
  For classes and class templates, the library Clauses specify partial
32
  definitions. Private members [[class.access]] are not specified, but
33
  each implementation shall supply them to complete the definitions
34
  according to the description in the library Clauses.
35
 
36
  For functions, function templates, objects, and values, the library
37
  Clauses specify declarations. Implementations shall supply definitions
38
  consistent with the descriptions in the library Clauses.
39
 
40
- The names defined in the library have namespace scope
41
- [[basic.namespace]]. A C++ translation unit [[lex.phases]] obtains
42
- access to these names by including the appropriate standard library
43
  header or importing the appropriate standard library named header unit
44
  [[using.headers]].
45
 
46
  The templates, classes, functions, and objects in the library have
47
  external linkage [[basic.link]]. The implementation provides definitions
48
  for standard library entities, as necessary, while combining translation
49
  units to form a complete C++ program [[lex.phases]].
50
 
51
  Two kinds of implementations are defined: a *hosted implementation* and
52
- a *freestanding implementation*. For a hosted implementation, this
53
- document defines the set of available libraries. A freestanding
54
- implementation is one in which execution may take place without the
55
- benefit of an operating system, and has an *implementation-defined* set
56
- of libraries that includes certain language-support libraries
57
- [[compliance]].
58
 
59
  A conforming implementation may have extensions (including additional
60
  library functions), provided they do not alter the behavior of any
61
  well-formed program. Implementations are required to diagnose programs
62
  that use such extensions that are ill-formed according to this document.
63
  Having done so, however, they can compile and execute such programs.
64
 
65
  Each implementation shall include documentation that identifies all
66
  conditionally-supported constructs that it does not support and defines
67
- all locale-specific characteristics.[^3]
68
 
69
  ### Abstract machine <a id="intro.abstract">[[intro.abstract]]</a>
70
 
71
  The semantic descriptions in this document define a parameterized
72
  nondeterministic abstract machine. This document places no requirement
73
  on the structure of conforming implementations. In particular, they need
74
  not copy or emulate the structure of the abstract machine. Rather,
75
  conforming implementations are required to emulate (only) the observable
76
- behavior of the abstract machine as explained below.[^4]
77
 
78
  Certain aspects and operations of the abstract machine are described in
79
  this document as implementation-defined (for example, `sizeof(int)`).
80
  These constitute the parameters of the abstract machine. Each
81
  implementation shall include documentation describing its
82
- characteristics and behavior in these respects.[^5] Such documentation
83
- shall define the instance of the abstract machine that corresponds to
84
- that implementation (referred to as the “corresponding instance below).
 
 
85
 
86
  Certain other aspects and operations of the abstract machine are
87
  described in this document as unspecified (for example, order of
88
  evaluation of arguments in a function call [[expr.call]]). Where
89
  possible, this document defines a set of allowable behaviors. These
@@ -119,11 +133,11 @@ The least requirements on a conforming implementation are:
119
 
120
  These collectively are referred to as the *observable behavior* of the
121
  program.
122
 
123
  [*Note 2*: More stringent correspondences between abstract and actual
124
- semantics may be defined by each implementation. — *end note*]
125
 
126
  ## Structure of this document <a id="intro.structure">[[intro.structure]]</a>
127
 
128
  [[lex]] through [[cpp]] describe the C++ programming language. That
129
  description includes detailed syntactic specifications in a form
@@ -141,14 +155,10 @@ implementations.
141
  [[diff]] summarizes the evolution of C++ since its first published
142
  description, and explains in detail the differences between C++ and C.
143
  Certain features of C++ exist solely for compatibility purposes;
144
  [[depr]] describes those features.
145
 
146
- Throughout this document, each example is introduced by “” and
147
- terminated by “”. Each note is introduced by “” or “” and terminated by
148
- “”. Examples and notes may be nested.
149
-
150
  ## Syntax notation <a id="syntax">[[syntax]]</a>
151
 
152
  In the syntax notation used in this document, syntactic categories are
153
  indicated by *italic* type, and literal words and characters in
154
  `constant` `width` type. Alternatives are listed on separate lines
@@ -174,103 +184,82 @@ the following rules:
174
  - *X-seq* is one or more *X*’s without intervening delimiters (e.g.,
175
  *declaration-seq* is a sequence of declarations).
176
  - *X-list* is one or more *X*’s separated by intervening commas (e.g.,
177
  *identifier-list* is a sequence of identifiers separated by commas).
178
 
179
- ## Acknowledgments <a id="intro.ack">[[intro.ack]]</a>
180
-
181
- The C++ programming language as described in this document is based on
182
- the language as described in Chapter R (Reference Manual) of Stroustrup:
183
- *The C++ Programming Language* (second edition, Addison-Wesley
184
- Publishing Company, ISBN 0-201-53992-6, copyright ©1991 AT&T). That, in
185
- turn, is based on the C programming language as described in Appendix A
186
- of Kernighan and Ritchie: *The C Programming Language* (Prentice-Hall,
187
- 1978, ISBN 0-13-110163-3, copyright ©1978 AT&T).
188
-
189
- Portions of the library Clauses of this document are based on work by
190
- P.J. Plauger, which was published as *The Draft Standard C++ Library*
191
- (Prentice-Hall, ISBN 0-13-117003-1, copyright ©1995 P.J. Plauger).
192
-
193
- POSIX® is a registered trademark of the Institute of Electrical and
194
- Electronic Engineers, Inc.
195
-
196
- ECMAScript® is a registered trademark of Ecma International.
197
-
198
- Unicode® is a registered trademark of Unicode, Inc.
199
-
200
- All rights in these originals are reserved.
201
-
202
  <!-- Link reference definitions -->
203
- [basic.def.odr]: basic.md#basic.def.odr
 
204
  [basic.link]: basic.md#basic.link
205
- [basic.namespace]: dcl.md#basic.namespace
206
- [basic.types]: basic.md#basic.types
207
  [class.access]: class.md#class.access
208
  [class.copy.assign]: class.md#class.copy.assign
209
  [class.ctor]: class.md#class.ctor
210
  [class.derived]: class.md#class.derived
211
  [compliance]: library.md#compliance
212
  [conv.lval]: expr.md#conv.lval
213
  [cpp]: cpp.md#cpp
214
- [cpp.replace]: cpp.md#cpp.replace
215
- [dcl.decl]: dcl.md#dcl.decl
216
- [dcl.fct]: dcl.md#dcl.fct
217
  [dcl.ptr]: dcl.md#dcl.ptr
218
  [dcl.ref]: dcl.md#dcl.ref
219
- [definitions]: library.md#definitions
220
  [defns.well.formed]: #defns.well.formed
221
  [depr]: future.md#depr
222
- [depr.locale.stdcvt]: future.md#depr.locale.stdcvt
223
  [diff]: compatibility.md#diff
224
  [diff.library]: compatibility.md#diff.library
225
  [expr.ass]: expr.md#expr.ass
226
  [expr.call]: expr.md#expr.call
227
  [expr.const]: expr.md#expr.const
228
  [expr.post.incr]: expr.md#expr.post.incr
229
  [expr.pre.incr]: expr.md#expr.pre.incr
230
- [expr.throw]: expr.md#expr.throw
231
  [gram]: grammar.md#gram
232
  [implimits]: limits.md#implimits
 
233
  [intro]: #intro
234
  [intro.abstract]: #intro.abstract
235
- [intro.ack]: #intro.ack
236
  [intro.compliance]: #intro.compliance
 
237
  [intro.defs]: #intro.defs
238
  [intro.execution]: basic.md#intro.execution
239
- [intro.object]: basic.md#intro.object
240
  [intro.refs]: #intro.refs
241
  [intro.scope]: #intro.scope
242
  [intro.structure]: #intro.structure
243
  [lex]: lex.md#lex
244
- [lex.charset]: lex.md#lex.charset
245
  [lex.phases]: lex.md#lex.phases
246
  [library]: library.md#library
247
- [stmt.block]: stmt.md#stmt.block
 
 
248
  [support]: support.md#support
249
  [syntax]: #syntax
250
- [temp.arg]: temp.md#temp.arg
251
  [temp.deduct]: temp.md#temp.deduct
252
  [thread]: thread.md#thread
253
  [using.headers]: library.md#using.headers
254
 
255
- [^1]: With the qualifications noted in [[support]] through [[thread]]
 
 
 
 
 
256
  and in [[diff.library]], the C standard library is a subset of the
257
  C++ standard library.
258
 
259
- [^2]: “Correct execution” can include undefined behavior, depending on
260
  the data being processed; see [[intro.defs]] and 
261
  [[intro.execution]].
262
 
263
- [^3]: This documentation also defines implementation-defined behavior;
264
  see  [[intro.abstract]].
265
 
266
- [^4]: This provision is sometimes called the “as-if” rule, because an
267
  implementation is free to disregard any requirement of this document
268
  as long as the result is *as if* the requirement had been obeyed, as
269
  far as can be determined from the observable behavior of the
270
  program. For instance, an actual implementation need not evaluate
271
  part of an expression if it can deduce that its value is not used
272
  and that no side effects affecting the observable behavior of the
273
  program are produced.
274
 
275
- [^5]: This documentation also includes conditionally-supported
276
- constructs and locale-specific behavior. See  [[intro.compliance]].
 
 
1
  # General principles <a id="intro">[[intro]]</a>
2
 
3
  ## Implementation compliance <a id="intro.compliance">[[intro.compliance]]</a>
4
 
5
+ ### General <a id="intro.compliance.general">[[intro.compliance.general]]</a>
6
+
7
  The set of *diagnosable rules* consists of all syntactic and semantic
8
  rules in this document except for those rules containing an explicit
9
  notation that “no diagnostic is required” or which are described as
10
  resulting in “undefined behavior”.
11
 
12
  Although this document states only requirements on C++ implementations,
13
  those requirements are often easier to understand if they are phrased as
14
  requirements on programs, parts of programs, or execution of programs.
15
  Such requirements have the following meaning:
16
 
17
+ - If a program contains no violations of the rules in [[lex]] through
18
+ [[thread]] and [[depr]], a conforming implementation shall, within its
19
+ resource limits as described in [[implimits]], accept and correctly
20
+ execute[^3] that program.
 
 
 
 
21
  - If a program contains a violation of a rule for which no diagnostic is
22
  required, this document places no requirement on implementations with
23
  respect to that program.
24
+ - Otherwise, if a program contains a violation of any diagnosable rule
25
+ or an occurrence of a construct described in this document as
26
+ “conditionally-supported” when the implementation does not support
27
+ that construct, a conforming implementation shall issue at least one
28
+ diagnostic message.
29
 
30
  [*Note 1*: During template argument deduction and substitution, certain
31
  constructs that in other contexts require a diagnostic are treated
32
  differently; see  [[temp.deduct]]. — *end note*]
33
 
34
+ Furthermore, a conforming implementation
35
+
36
+ - shall not accept a preprocessing translation unit containing a
37
+ `#error` preprocessing directive [[cpp.error]],
38
+ - shall issue at least one diagnostic message for each `#warning` or
39
+ `#error` preprocessing directive not following a `#error`
40
+ preprocessing directive in a preprocessing translation unit, and
41
+ - shall not accept a translation unit with a *static_assert-declaration*
42
+ that fails [[dcl.pre]].
43
+
44
  For classes and class templates, the library Clauses specify partial
45
  definitions. Private members [[class.access]] are not specified, but
46
  each implementation shall supply them to complete the definitions
47
  according to the description in the library Clauses.
48
 
49
  For functions, function templates, objects, and values, the library
50
  Clauses specify declarations. Implementations shall supply definitions
51
  consistent with the descriptions in the library Clauses.
52
 
53
+ A C++ translation unit [[lex.phases]] obtains access to the names
54
+ defined in the library by including the appropriate standard library
 
55
  header or importing the appropriate standard library named header unit
56
  [[using.headers]].
57
 
58
  The templates, classes, functions, and objects in the library have
59
  external linkage [[basic.link]]. The implementation provides definitions
60
  for standard library entities, as necessary, while combining translation
61
  units to form a complete C++ program [[lex.phases]].
62
 
63
  Two kinds of implementations are defined: a *hosted implementation* and
64
+ a *freestanding implementation*. A freestanding implementation is one in
65
+ which execution may take place without the benefit of an operating
66
+ system. A hosted implementation supports all the facilities described in
67
+ this document, while a freestanding implementation supports the entire
68
+ C++ language described in [[lex]] through [[cpp]] and the subset of the
69
+ library facilities described in [[compliance]].
70
 
71
  A conforming implementation may have extensions (including additional
72
  library functions), provided they do not alter the behavior of any
73
  well-formed program. Implementations are required to diagnose programs
74
  that use such extensions that are ill-formed according to this document.
75
  Having done so, however, they can compile and execute such programs.
76
 
77
  Each implementation shall include documentation that identifies all
78
  conditionally-supported constructs that it does not support and defines
79
+ all locale-specific characteristics.[^4]
80
 
81
  ### Abstract machine <a id="intro.abstract">[[intro.abstract]]</a>
82
 
83
  The semantic descriptions in this document define a parameterized
84
  nondeterministic abstract machine. This document places no requirement
85
  on the structure of conforming implementations. In particular, they need
86
  not copy or emulate the structure of the abstract machine. Rather,
87
  conforming implementations are required to emulate (only) the observable
88
+ behavior of the abstract machine as explained below.[^5]
89
 
90
  Certain aspects and operations of the abstract machine are described in
91
  this document as implementation-defined (for example, `sizeof(int)`).
92
  These constitute the parameters of the abstract machine. Each
93
  implementation shall include documentation describing its
94
+ characteristics and behavior in these respects.[^6]
95
+
96
+ Such documentation shall define the instance of the abstract machine
97
+ that corresponds to that implementation (referred to as the
98
+ “corresponding instance” below).
99
 
100
  Certain other aspects and operations of the abstract machine are
101
  described in this document as unspecified (for example, order of
102
  evaluation of arguments in a function call [[expr.call]]). Where
103
  possible, this document defines a set of allowable behaviors. These
 
133
 
134
  These collectively are referred to as the *observable behavior* of the
135
  program.
136
 
137
  [*Note 2*: More stringent correspondences between abstract and actual
138
+ semantics can be defined by each implementation. — *end note*]
139
 
140
  ## Structure of this document <a id="intro.structure">[[intro.structure]]</a>
141
 
142
  [[lex]] through [[cpp]] describe the C++ programming language. That
143
  description includes detailed syntactic specifications in a form
 
155
  [[diff]] summarizes the evolution of C++ since its first published
156
  description, and explains in detail the differences between C++ and C.
157
  Certain features of C++ exist solely for compatibility purposes;
158
  [[depr]] describes those features.
159
 
 
 
 
 
160
  ## Syntax notation <a id="syntax">[[syntax]]</a>
161
 
162
  In the syntax notation used in this document, syntactic categories are
163
  indicated by *italic* type, and literal words and characters in
164
  `constant` `width` type. Alternatives are listed on separate lines
 
184
  - *X-seq* is one or more *X*’s without intervening delimiters (e.g.,
185
  *declaration-seq* is a sequence of declarations).
186
  - *X-list* is one or more *X*’s separated by intervening commas (e.g.,
187
  *identifier-list* is a sequence of identifiers separated by commas).
188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  <!-- Link reference definitions -->
190
+ [algorithm.stable]: library.md#algorithm.stable
191
+ [basic.fundamental]: basic.md#basic.fundamental
192
  [basic.link]: basic.md#basic.link
 
 
193
  [class.access]: class.md#class.access
194
  [class.copy.assign]: class.md#class.copy.assign
195
  [class.ctor]: class.md#class.ctor
196
  [class.derived]: class.md#class.derived
197
  [compliance]: library.md#compliance
198
  [conv.lval]: expr.md#conv.lval
199
  [cpp]: cpp.md#cpp
200
+ [cpp.error]: cpp.md#cpp.error
201
+ [dcl.pre]: dcl.md#dcl.pre
 
202
  [dcl.ptr]: dcl.md#dcl.ptr
203
  [dcl.ref]: dcl.md#dcl.ref
204
+ [defns.repositional.stream]: #defns.repositional.stream
205
  [defns.well.formed]: #defns.well.formed
206
  [depr]: future.md#depr
 
207
  [diff]: compatibility.md#diff
208
  [diff.library]: compatibility.md#diff.library
209
  [expr.ass]: expr.md#expr.ass
210
  [expr.call]: expr.md#expr.call
211
  [expr.const]: expr.md#expr.const
212
  [expr.post.incr]: expr.md#expr.post.incr
213
  [expr.pre.incr]: expr.md#expr.pre.incr
 
214
  [gram]: grammar.md#gram
215
  [implimits]: limits.md#implimits
216
+ [input.output]: input.md#input.output
217
  [intro]: #intro
218
  [intro.abstract]: #intro.abstract
 
219
  [intro.compliance]: #intro.compliance
220
+ [intro.compliance.general]: #intro.compliance.general
221
  [intro.defs]: #intro.defs
222
  [intro.execution]: basic.md#intro.execution
 
223
  [intro.refs]: #intro.refs
224
  [intro.scope]: #intro.scope
225
  [intro.structure]: #intro.structure
226
  [lex]: lex.md#lex
 
227
  [lex.phases]: lex.md#lex.phases
228
  [library]: library.md#library
229
+ [localization]: localization.md#localization
230
+ [re]: re.md#re
231
+ [strings]: strings.md#strings
232
  [support]: support.md#support
233
  [syntax]: #syntax
 
234
  [temp.deduct]: temp.md#temp.deduct
235
  [thread]: thread.md#thread
236
  [using.headers]: library.md#using.headers
237
 
238
+ [^1]: POSIX is a registered trademark of the Institute of Electrical and
239
+ Electronic Engineers, Inc. This information is given for the
240
+ convenience of users of this document and does not constitute an
241
+ endorsement by ISO or IEC of this product.
242
+
243
+ [^2]: With the qualifications noted in [[support]] through [[thread]]
244
  and in [[diff.library]], the C standard library is a subset of the
245
  C++ standard library.
246
 
247
+ [^3]: “Correct execution” can include undefined behavior, depending on
248
  the data being processed; see [[intro.defs]] and 
249
  [[intro.execution]].
250
 
251
+ [^4]: This documentation also defines implementation-defined behavior;
252
  see  [[intro.abstract]].
253
 
254
+ [^5]: This provision is sometimes called the “as-if” rule, because an
255
  implementation is free to disregard any requirement of this document
256
  as long as the result is *as if* the requirement had been obeyed, as
257
  far as can be determined from the observable behavior of the
258
  program. For instance, an actual implementation need not evaluate
259
  part of an expression if it can deduce that its value is not used
260
  and that no side effects affecting the observable behavior of the
261
  program are produced.
262
 
263
+ [^6]: This documentation also includes conditionally-supported
264
+ constructs and locale-specific behavior. See 
265
+ [[intro.compliance.general]].