From Jason Turner

[basic.align]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3qatjenw/{from.md → to.md} +47 -33
tmp/tmp3qatjenw/{from.md → to.md} RENAMED
@@ -47,14 +47,14 @@ Alignments have an order from *weaker* to *stronger* or *stricter*
47
  alignments. Stricter alignments have larger alignment values. An address
48
  that satisfies an alignment requirement also satisfies any weaker valid
49
  alignment requirement.
50
 
51
  The alignment requirement of a complete type can be queried using an
52
- `alignof` expression ([[expr.alignof]]). Furthermore, the types `char`,
53
- `signed char`, and `unsigned char` shall have the weakest alignment
54
- requirement. This enables the character types to be used as the
55
- underlying type for an aligned memory area ([[dcl.align]]).
56
 
57
  Comparing alignments is meaningful and provides the obvious results:
58
 
59
  - Two alignments are equal when their numeric values are equal.
60
  - Two alignments are different when their numeric values are not equal.
@@ -91,15 +91,15 @@ allocation failure.
91
  [basic.lookup.udir]: #basic.lookup.udir
92
  [basic.lookup.unqual]: #basic.lookup.unqual
93
  [basic.lval]: #basic.lval
94
  [basic.namespace]: dcl.md#basic.namespace
95
  [basic.scope]: #basic.scope
 
96
  [basic.scope.class]: #basic.scope.class
97
  [basic.scope.declarative]: #basic.scope.declarative
98
  [basic.scope.enum]: #basic.scope.enum
99
  [basic.scope.hiding]: #basic.scope.hiding
100
- [basic.scope.local]: #basic.scope.local
101
  [basic.scope.namespace]: #basic.scope.namespace
102
  [basic.scope.pdecl]: #basic.scope.pdecl
103
  [basic.scope.proto]: #basic.scope.proto
104
  [basic.scope.temp]: #basic.scope.temp
105
  [basic.start]: #basic.start
@@ -142,18 +142,18 @@ allocation failure.
142
  [class.this]: class.md#class.this
143
  [class.union]: class.md#class.union
144
  [conv]: conv.md#conv
145
  [conv.array]: conv.md#conv.array
146
  [conv.func]: conv.md#conv.func
 
147
  [conv.lval]: conv.md#conv.lval
148
  [conv.mem]: conv.md#conv.mem
149
  [conv.prom]: conv.md#conv.prom
150
  [conv.ptr]: conv.md#conv.ptr
151
  [conv.qual]: conv.md#conv.qual
152
  [dcl.align]: dcl.md#dcl.align
153
  [dcl.array]: dcl.md#dcl.array
154
- [dcl.constexpr]: dcl.md#dcl.constexpr
155
  [dcl.dcl]: dcl.md#dcl.dcl
156
  [dcl.decl]: dcl.md#dcl.decl
157
  [dcl.enum]: dcl.md#dcl.enum
158
  [dcl.fct]: dcl.md#dcl.fct
159
  [dcl.fct.def]: dcl.md#dcl.fct.def
@@ -162,17 +162,20 @@ allocation failure.
162
  [dcl.init]: dcl.md#dcl.init
163
  [dcl.init.aggr]: dcl.md#dcl.init.aggr
164
  [dcl.init.ref]: dcl.md#dcl.init.ref
165
  [dcl.link]: dcl.md#dcl.link
166
  [dcl.mptr]: dcl.md#dcl.mptr
 
167
  [dcl.ptr]: dcl.md#dcl.ptr
168
  [dcl.ref]: dcl.md#dcl.ref
 
169
  [dcl.stc]: dcl.md#dcl.stc
170
  [dcl.type.cv]: dcl.md#dcl.type.cv
171
  [dcl.type.elab]: dcl.md#dcl.type.elab
172
  [dcl.type.simple]: dcl.md#dcl.type.simple
173
  [dcl.typedef]: dcl.md#dcl.typedef
 
174
  [except]: except.md#except
175
  [except.handle]: except.md#except.handle
176
  [except.spec]: except.md#except.spec
177
  [except.terminate]: except.md#except.terminate
178
  [except.throw]: except.md#except.throw
@@ -185,12 +188,14 @@ allocation failure.
185
  [expr.comma]: expr.md#expr.comma
186
  [expr.cond]: expr.md#expr.cond
187
  [expr.const]: expr.md#expr.const
188
  [expr.delete]: expr.md#expr.delete
189
  [expr.dynamic.cast]: expr.md#expr.dynamic.cast
 
190
  [expr.new]: expr.md#expr.new
191
  [expr.prim]: expr.md#expr.prim
 
192
  [expr.pseudo]: expr.md#expr.pseudo
193
  [expr.ref]: expr.md#expr.ref
194
  [expr.sizeof]: expr.md#expr.sizeof
195
  [expr.static.cast]: expr.md#expr.static.cast
196
  [expr.type.conv]: expr.md#expr.type.conv
@@ -217,10 +222,11 @@ allocation failure.
217
  [over]: over.md#over
218
  [over.literal]: over.md#over.literal
219
  [over.load]: over.md#over.load
220
  [over.match]: over.md#over.match
221
  [over.oper]: over.md#over.oper
 
222
  [ptr.align]: utilities.md#ptr.align
223
  [replacement.functions]: library.md#replacement.functions
224
  [set.new.handler]: language.md#set.new.handler
225
  [stmt.block]: stmt.md#stmt.block
226
  [stmt.dcl]: stmt.md#stmt.dcl
@@ -279,93 +285,101 @@ allocation failure.
279
  [^6]: This lookup applies whether the definition of `X` is nested within
280
  `Y`’s definition or whether `X`’s definition appears in a namespace
281
  scope enclosing `Y` ’s definition ([[class.nest]]).
282
 
283
  [^7]: That is, an unqualified name that occurs, for instance, in a type
284
- or default argument in the *parameter-declaration-clause* or in the
285
- function body.
286
 
287
  [^8]: This lookup applies whether the member function is defined within
288
  the definition of class `X` or whether the member function is
289
  defined in a namespace scope enclosing `X`’s definition.
290
 
291
- [^9]: A class template always has external linkage, and the requirements
292
- of  [[temp.arg.type]] and  [[temp.arg.nontype]] ensure that the
293
- template arguments will also have appropriate linkage.
294
 
295
- [^10]: A non-local variable with static storage duration having
 
 
 
 
296
  initialization with side-effects must be initialized even if it is
297
  not odr-used ([[basic.def.odr]],  [[basic.stc.static]]).
298
 
299
- [^11]: The intent is to have `operator new()` implementable by calling
300
  `std::malloc()` or `std::calloc()`, so the rules are substantially
301
  the same. C++differs from C in requiring a zero request to return a
302
  non-null pointer.
303
 
304
- [^12]: On some implementations, it causes a system-generated runtime
305
- fault.
 
306
 
307
- [^13]: This section does not impose restrictions on dereferencing
 
 
 
308
  pointers to memory not allocated by `::operator new`. This maintains
309
  the ability of many C++implementations to use binary libraries and
310
  components written in other languages. In particular, this applies
311
- to C binaries, because dereferencing pointers to memory allocated by
312
- `malloc` is not restricted.
313
 
314
- [^14]: For example, before the construction of a global object of
315
  non-POD class type ([[class.cdtor]]).
316
 
317
- [^15]: That is, an object for which a destructor will be called
318
  implicitly—upon exit from the block for an object with automatic
319
  storage duration, upon exit from the thread for an object with
320
  thread storage duration, or upon exit from the program for an object
321
  with static storage duration.
322
 
323
- [^16]: By using, for example, the library functions ([[headers]])
324
  `std::memcpy` or `std::memmove`.
325
 
326
- [^17]: By using, for example, the library functions ([[headers]])
327
  `std::memcpy` or `std::memmove`.
328
 
329
- [^18]: The intent is that the memory model of C++is compatible with that
330
  of ISO/IEC 9899 Programming Language C.
331
 
332
- [^19]: The size and layout of an instance of an incompletely-defined
333
  object type is unknown.
334
 
335
- [^20]: that is, large enough to contain any value in the range of
336
  `INT_MIN` and `INT_MAX`, as defined in the header `<climits>`.
337
 
338
- [^21]: See  [[dcl.type.simple]] regarding the correspondence between
339
  types and the sequences of *type-specifier*s that designate them.
340
 
341
- [^22]: This implies that unsigned arithmetic does not overflow because a
342
  result that cannot be represented by the resulting unsigned integer
343
  type is reduced modulo the number that is one greater than the
344
  largest value that can be represented by the resulting unsigned
345
  integer type.
346
 
347
- [^23]: Using a `bool` value in ways described by this International
348
  Standard as “undefined,” such as by examining the value of an
349
  uninitialized automatic object, might cause it to behave as if it is
350
  neither `true` nor `false`.
351
 
352
- [^24]: Therefore, enumerations ([[dcl.enum]]) are not integral;
353
  however, enumerations can be promoted to integral types as specified
354
  in  [[conv.prom]].
355
 
356
- [^25]: A positional representation for integers that uses the binary
357
  digits 0 and 1, in which the values represented by successive bits
358
  are additive, begin with 1, and are multiplied by successive
359
  integral power of 2, except perhaps for the bit with the highest
360
  position. (Adapted from the *American National Dictionary for
361
  Information Processing Systems*.)
362
 
363
- [^26]: Static class members are objects or functions, and pointers to
364
  them are ordinary pointers to objects or functions.
365
 
366
- [^27]: The same representation and alignment requirements are meant to
367
  imply interchangeability as arguments to functions, return values
368
  from functions, and non-static data members of unions.
369
 
370
- [^28]: The intent of this list is to specify those circumstances in
371
  which an object may or may not be aliased.
 
47
  alignments. Stricter alignments have larger alignment values. An address
48
  that satisfies an alignment requirement also satisfies any weaker valid
49
  alignment requirement.
50
 
51
  The alignment requirement of a complete type can be queried using an
52
+ `alignof` expression ([[expr.alignof]]). Furthermore, the narrow
53
+ character types ([[basic.fundamental]]) shall have the weakest
54
+ alignment requirement. This enables the narrow character types to be
55
+ used as the underlying type for an aligned memory area ([[dcl.align]]).
56
 
57
  Comparing alignments is meaningful and provides the obvious results:
58
 
59
  - Two alignments are equal when their numeric values are equal.
60
  - Two alignments are different when their numeric values are not equal.
 
91
  [basic.lookup.udir]: #basic.lookup.udir
92
  [basic.lookup.unqual]: #basic.lookup.unqual
93
  [basic.lval]: #basic.lval
94
  [basic.namespace]: dcl.md#basic.namespace
95
  [basic.scope]: #basic.scope
96
+ [basic.scope.block]: #basic.scope.block
97
  [basic.scope.class]: #basic.scope.class
98
  [basic.scope.declarative]: #basic.scope.declarative
99
  [basic.scope.enum]: #basic.scope.enum
100
  [basic.scope.hiding]: #basic.scope.hiding
 
101
  [basic.scope.namespace]: #basic.scope.namespace
102
  [basic.scope.pdecl]: #basic.scope.pdecl
103
  [basic.scope.proto]: #basic.scope.proto
104
  [basic.scope.temp]: #basic.scope.temp
105
  [basic.start]: #basic.start
 
142
  [class.this]: class.md#class.this
143
  [class.union]: class.md#class.union
144
  [conv]: conv.md#conv
145
  [conv.array]: conv.md#conv.array
146
  [conv.func]: conv.md#conv.func
147
+ [conv.integral]: conv.md#conv.integral
148
  [conv.lval]: conv.md#conv.lval
149
  [conv.mem]: conv.md#conv.mem
150
  [conv.prom]: conv.md#conv.prom
151
  [conv.ptr]: conv.md#conv.ptr
152
  [conv.qual]: conv.md#conv.qual
153
  [dcl.align]: dcl.md#dcl.align
154
  [dcl.array]: dcl.md#dcl.array
 
155
  [dcl.dcl]: dcl.md#dcl.dcl
156
  [dcl.decl]: dcl.md#dcl.decl
157
  [dcl.enum]: dcl.md#dcl.enum
158
  [dcl.fct]: dcl.md#dcl.fct
159
  [dcl.fct.def]: dcl.md#dcl.fct.def
 
162
  [dcl.init]: dcl.md#dcl.init
163
  [dcl.init.aggr]: dcl.md#dcl.init.aggr
164
  [dcl.init.ref]: dcl.md#dcl.init.ref
165
  [dcl.link]: dcl.md#dcl.link
166
  [dcl.mptr]: dcl.md#dcl.mptr
167
+ [dcl.name]: dcl.md#dcl.name
168
  [dcl.ptr]: dcl.md#dcl.ptr
169
  [dcl.ref]: dcl.md#dcl.ref
170
+ [dcl.spec]: dcl.md#dcl.spec
171
  [dcl.stc]: dcl.md#dcl.stc
172
  [dcl.type.cv]: dcl.md#dcl.type.cv
173
  [dcl.type.elab]: dcl.md#dcl.type.elab
174
  [dcl.type.simple]: dcl.md#dcl.type.simple
175
  [dcl.typedef]: dcl.md#dcl.typedef
176
+ [diff.cpp11.basic]: compatibility.md#diff.cpp11.basic
177
  [except]: except.md#except
178
  [except.handle]: except.md#except.handle
179
  [except.spec]: except.md#except.spec
180
  [except.terminate]: except.md#except.terminate
181
  [except.throw]: except.md#except.throw
 
188
  [expr.comma]: expr.md#expr.comma
189
  [expr.cond]: expr.md#expr.cond
190
  [expr.const]: expr.md#expr.const
191
  [expr.delete]: expr.md#expr.delete
192
  [expr.dynamic.cast]: expr.md#expr.dynamic.cast
193
+ [expr.mptr.oper]: expr.md#expr.mptr.oper
194
  [expr.new]: expr.md#expr.new
195
  [expr.prim]: expr.md#expr.prim
196
+ [expr.prim.general]: expr.md#expr.prim.general
197
  [expr.pseudo]: expr.md#expr.pseudo
198
  [expr.ref]: expr.md#expr.ref
199
  [expr.sizeof]: expr.md#expr.sizeof
200
  [expr.static.cast]: expr.md#expr.static.cast
201
  [expr.type.conv]: expr.md#expr.type.conv
 
222
  [over]: over.md#over
223
  [over.literal]: over.md#over.literal
224
  [over.load]: over.md#over.load
225
  [over.match]: over.md#over.match
226
  [over.oper]: over.md#over.oper
227
+ [over.over]: over.md#over.over
228
  [ptr.align]: utilities.md#ptr.align
229
  [replacement.functions]: library.md#replacement.functions
230
  [set.new.handler]: language.md#set.new.handler
231
  [stmt.block]: stmt.md#stmt.block
232
  [stmt.dcl]: stmt.md#stmt.dcl
 
285
  [^6]: This lookup applies whether the definition of `X` is nested within
286
  `Y`’s definition or whether `X`’s definition appears in a namespace
287
  scope enclosing `Y` ’s definition ([[class.nest]]).
288
 
289
  [^7]: That is, an unqualified name that occurs, for instance, in a type
290
+ in the *parameter-declaration-clause* or in the
291
+ *exception-specification*.
292
 
293
  [^8]: This lookup applies whether the member function is defined within
294
  the definition of class `X` or whether the member function is
295
  defined in a namespace scope enclosing `X`’s definition.
296
 
297
+ [^9]: Lookups in which function names are ignored include names
298
+ appearing in a *nested-name-specifier*, an
299
+ *elaborated-type-specifier*, or a *base-specifier*.
300
 
301
+ [^10]: A class template always has external linkage, and the
302
+ requirements of  [[temp.arg.type]] and  [[temp.arg.nontype]] ensure
303
+ that the template arguments will also have appropriate linkage.
304
+
305
+ [^11]: A non-local variable with static storage duration having
306
  initialization with side-effects must be initialized even if it is
307
  not odr-used ([[basic.def.odr]],  [[basic.stc.static]]).
308
 
309
+ [^12]: The intent is to have `operator new()` implementable by calling
310
  `std::malloc()` or `std::calloc()`, so the rules are substantially
311
  the same. C++differs from C in requiring a zero request to return a
312
  non-null pointer.
313
 
314
+ [^13]: This deallocation function precludes use of an allocation
315
+ function `void operator new(std::size_t, std::size_t)` as a
316
+ placement allocation function ([[diff.cpp11.basic]]).
317
 
318
+ [^14]: Some implementations might define that copying an invalid pointer
319
+ value causes a system-generated runtime fault.
320
+
321
+ [^15]: This section does not impose restrictions on indirection through
322
  pointers to memory not allocated by `::operator new`. This maintains
323
  the ability of many C++implementations to use binary libraries and
324
  components written in other languages. In particular, this applies
325
+ to C binaries, because indirection through pointers to memory
326
+ allocated by `std::malloc` is not restricted.
327
 
328
+ [^16]: For example, before the construction of a global object of
329
  non-POD class type ([[class.cdtor]]).
330
 
331
+ [^17]: That is, an object for which a destructor will be called
332
  implicitly—upon exit from the block for an object with automatic
333
  storage duration, upon exit from the thread for an object with
334
  thread storage duration, or upon exit from the program for an object
335
  with static storage duration.
336
 
337
+ [^18]: By using, for example, the library functions ([[headers]])
338
  `std::memcpy` or `std::memmove`.
339
 
340
+ [^19]: By using, for example, the library functions ([[headers]])
341
  `std::memcpy` or `std::memmove`.
342
 
343
+ [^20]: The intent is that the memory model of C++is compatible with that
344
  of ISO/IEC 9899 Programming Language C.
345
 
346
+ [^21]: The size and layout of an instance of an incompletely-defined
347
  object type is unknown.
348
 
349
+ [^22]: that is, large enough to contain any value in the range of
350
  `INT_MIN` and `INT_MAX`, as defined in the header `<climits>`.
351
 
352
+ [^23]: See  [[dcl.type.simple]] regarding the correspondence between
353
  types and the sequences of *type-specifier*s that designate them.
354
 
355
+ [^24]: This implies that unsigned arithmetic does not overflow because a
356
  result that cannot be represented by the resulting unsigned integer
357
  type is reduced modulo the number that is one greater than the
358
  largest value that can be represented by the resulting unsigned
359
  integer type.
360
 
361
+ [^25]: Using a `bool` value in ways described by this International
362
  Standard as “undefined,” such as by examining the value of an
363
  uninitialized automatic object, might cause it to behave as if it is
364
  neither `true` nor `false`.
365
 
366
+ [^26]: Therefore, enumerations ([[dcl.enum]]) are not integral;
367
  however, enumerations can be promoted to integral types as specified
368
  in  [[conv.prom]].
369
 
370
+ [^27]: A positional representation for integers that uses the binary
371
  digits 0 and 1, in which the values represented by successive bits
372
  are additive, begin with 1, and are multiplied by successive
373
  integral power of 2, except perhaps for the bit with the highest
374
  position. (Adapted from the *American National Dictionary for
375
  Information Processing Systems*.)
376
 
377
+ [^28]: Static class members are objects or functions, and pointers to
378
  them are ordinary pointers to objects or functions.
379
 
380
+ [^29]: The same representation and alignment requirements are meant to
381
  imply interchangeability as arguments to functions, return values
382
  from functions, and non-static data members of unions.
383
 
384
+ [^30]: The intent of this list is to specify those circumstances in
385
  which an object may or may not be aliased.