<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Core Issue 1776: Replacement of class objects containing reference members</title>

<style type="text/css">
  ins, ins * { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  del, del * { text-decoration:line-through; background-color:#FFA0A0 }
  #hidedel:checked ~ * del, #hidedel:checked ~ * del * { display:none; visibility:hidden }

blockquote { color: #000000; background-color: #F1F1F1;
  border: 1px solid #D1D1D1;
  padding-left: 0.5em; padding-right: 0.5em; }
blockquote.stdins { text-decoration: underline;
  color: #000000; background-color: #C8FFC8;
  border: 1px solid #B3EBB3; padding: 0.5em; }
blockquote.stddel { text-decoration: line-through;
  color: #000000; background-color: #FFEBFF;
  border: 1px solid #ECD7EC;
  padding-left: 0.5empadding-right: 0.5em; ; }
</style>

</head>

<body>
<div style="text-align: right; float: right">
ISO/IEC JTC1 SC22 WG21<br>
P0137R0<br>
Richard Smith<br>
richard@metafoo.co.uk<br>
2015-09-27<br>
</div>

<h1>Core Issue 1776: Replacement of class objects containing reference members</h1>

And also Core Issue 1116: Aliasing of union members<br>

<!--

DONE:
1.8p1: object occupies storage during period of construction and period of destruction
3.8p7: add cross-reference to std::launder and a note explaining when to use it
3.9.2p3: "pointer past the end of an object represents the address of the first byte"... no, it does not! say exactly what it does mean.
3.9.2p3:
  Every value of pointer type is one of the following:
    - a pointer to
    - a pointer past the end of
    - a null pointer value
    - an invalid pointer value
3.9.2, 5.7: Replace "... element i" with "an array <ins>x</ins> of n elements [...] element x[i]".
3.9.2p3: s/object pointer type cv T*/pointer type/
8.3.4: add wording to say that a pointer to an array object represents the same address as a pointer to the array's first element (but you can't alias between them).
vacuous initialization of a union should not start the lifetime of any union member
union active member change: expr.member = blah (for builtin =) changes active member. likewise for anonymous unions.

NOT DONE:
3.9.2p3: need a pointer-to-allocated-storage? no, allocating storage gives you an array of unsigned char
9.5p1: period of construction and destruction here too

TODO:

add notes from hubert's 6 Mar email

-->

<input type="checkbox" id="hidedel">Hide deleted text

<p>
Change in 1.8 (intro.object) paragraph 1:
</p>

<blockquote>
The constructs in a C++
program create, destroy, refer to, access, and manipulate objects.
<ins>
An <em>object</em> is created by a <em>definition</em> (3.1), by a <em>new-expression</em> (5.3.4)
or by the implementation (5.18, 12.2) when needed.
</ins>
An <del><em>object</em> is</del><ins>object occupies</ins> a region of storage <ins>in its period of construction (12.7 class.cdtor), throughout its lifetime (3.8 basic.life), and in its period of destruction (12.7 class.cdtor)</ins>.
[&nbsp;<em>Note</em>:
A function is not an object, regardless of whether or not it occupies storage in the
way that objects do.
&mdash;&nbsp;<em>end note</em>&nbsp;]
<del>
An object is created by a <em>definition</em> (3.1), by a <em>new-expression</em> (5.3.4)
or by the implementation (12.2) when needed.
</del>
[&hellip;]
</blockquote>

<em>Drafting note: this maintains the status quo that <tt>malloc</tt> alone is
  not sufficient to create an object.</em>
<em>Drafting note: the terms "period of construction" and "period of destruction"
  are in core issue 1517, which is not yet approved, but their use here seems
  sufficiently clear with or without that change.</em>

<p>
Change in 1.8 (intro.object) paragraph 6:
</p>

<blockquote>
Unless an object is a bit-field or a base class subobject of zero size,
the address of that object is the address of the first byte it occupies.
Two objects <ins>with overlapping lifetimes</ins> that are not bit-fields
may have the same address if one is a subobject of the other,
or if at least one is a base class subobject of zero size and they are of different types;
otherwise, they shall have distinct addresses. [Footnote: &hellip;] [Example: &hellip;]
</blockquote>

<p>
Add a new paragraph after 3.7 (basic.stc) paragraph 3:
</p>

<blockquote class="stdins">
When the end of the duration of a region of storage is reached,
the values of all pointers representing the address of
any part of the deallocated storage
become invalid pointer values ([basic.compound]).
Indirection through
an invalid pointer value and passing an invalid pointer value to a deallocation
function have undefined behavior. Any other use of an invalid pointer value has
implementation-defined behavior.
[&nbsp;<em>Footnote</em>:
Some implementations might define that copying an invalid pointer value causes
a system-generated runtime fault.
&mdash;&nbsp;<em>end footnote</em>&nbsp;]
</blockquote>

<em>Drafting note: this should apply to all storage durations that can end,
  not just to dynamic storage duration. On an implementation supporting threads
  or segmented stacks, thread and automatic storage may behave in the same
  way that dynamic storage does.</em>

<p>
Change in 3.7.4.1 (basic.stc.dynamic.allocation) paragraph 2:
</p>

<blockquote>
[&hellip;]
Furthermore, for the library allocation functions in 18.6.1.1 and
18.6.1.2, p0 shall <del>point to</del> <ins>represent the address of</ins>
a block of storage disjoint from the storage for
any other object accessible to the caller. The effect of indirecting through a
pointer returned as a request for zero size is undefined.
</blockquote>

<p>
Change in 3.7.4.1 (basic.stc.dynamic.allocation) paragraph 2:
</p>

<blockquote>
If the argument given to a deallocation function in the standard library is a
pointer that is not the null pointer value (4.10), the deallocation function
shall deallocate the storage referenced by the pointer,
<ins>ending the duration of the region of storage.<ins>
<del>
rendering invalid all
pointers referring to any part of the deallocated storage. Indirection through
an invalid pointer value and passing an invalid pointer value to a deallocation
function have undefined behavior. Any other use of an invalid pointer value has
implementation-defined behavior.
[&nbsp;<em>Footnote</em>:
Some implementations might define that copying an invalid pointer value causes
a system-generated runtime fault.
&mdash;&nbsp;<em>end footnote</em>&nbsp;]
</del>
</ins></ins></blockquote>

<p>
Change in 3.8 (basic.life) paragraph 1:
</p>

<blockquote>
The <i>lifetime</i> of an object is a runtime property of the object. An object is
said to have <i>non-vacuous initialization</i> if it is of a class or aggregate type
and it or one of its members is initialized by a constructor other than a
trivial default constructor.
[&nbsp;<em>Note</em>: 
initialization by a trivial copy/move
constructor is non-vacuous initialization.
&mdash;&nbsp;<em>end note</em>&nbsp;]
The lifetime of an object of type <tt>T</tt> begins when:
<ul>
<li>storage with the proper alignment and size for type T is obtained, and
<li><ins>if the object is a union member or subobject thereof, that union
member is the initialized member in the union (8.5.1, 12.6.2), and</ins>
<li>if the object has non-vacuous initialization, its initialization is complete.
</ul>
<ins>The lifetime of an object generated by the implementation to hold a union
  member may also begin as described in 5.2.5.</ins>
[&hellip;]
</blockquote>

<p>
Change in 3.8 (basic.life) paragraph 5:
</p>

<blockquote>
Before the lifetime of an object has started but after the storage which the object will occupy has been allocated [Footnote: &hellip;] or,
after the lifetime of an object has ended and before the storage which the object occupied is reused or released,
any pointer that <del>refers to</del> <ins>represents the address of</ins> the storage location
where the object will be or was located may be used but only in limited ways.
[&hellip;]
</blockquote>

<p>
Change in 3.8 (basic.life) paragraph 7:
</p>

<blockquote>
If, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, a new object is created at the storage location which the original object occupied, a pointer that pointed to the original object, a reference that referred to the original object, or the name of the original object will automatically refer to the new object and, once the lifetime of the new object has started, can be used to manipulate the new object, if:
<ul><li>[&hellip;]</ul>
[&nbsp;<em>Example</em>: &hellip; &mdash;&nbsp;<em>end example</em>&nbsp;]
<ins>
[&nbsp;<em>Note</em>: 
If these conditions are not met, a pointer to the new object can be obtained
from a pointer that represents the address of its storage by calling
<tt>std::launder</tt> (18.6 [support.dynamic]).
&mdash;&nbsp;<em>end note</em>&nbsp;]
</ins>
</blockquote>

<p>
Change in 3.8 (basic.life) paragraph 9:
</p>

<blockquote>
Creating a new object at the storage location that a <tt>const</tt> <ins>complete</ins> object with static<del>,</del> <ins>or</ins> thread<del>, or automatic</del> storage
duration occupies or<del>,</del> at the storage location that such a <tt>const</tt> object used to occupy before its lifetime
ended results in undefined behavior. [Example: &hellip;]
</blockquote>

<em>This is necessary to allow types such as <tt>std::optional</tt> to contain const subobjects; the existing restriction exists to allow ROMability, and so only affects complete objects and is not necessary for automatic storage duration objects.</em>

<p>
Change in 3.9.2 (basic.compound) paragraph 3:
</p>

<blockquote>
[&hellip;]
<ins>Every value of pointer type is one of the following:
<ul><li>a <em>pointer to</em> an object or function (the pointer is said to <i>point to</i> the object or function), or
    </li><li>a <em>pointer past the end of</em> an object (5.3.1 expr.unary.op), or
    </li><li>the <em>null pointer value</em> (4.10 conv.ptr) for that type, or
    </li><li>an <em>invalid pointer value</em>.
</li></ul>
</ins>
A <del>valid</del> value of a<del>n object</del> pointer type <ins>that is a pointer to or past the end of an object</ins> <del>represents either
the address</del> <ins><em>represents the address</em></ins>
of <del>a</del> <ins>the first</ins> byte in memory (1.7 intro.memory)
<ins>that the object occupies or the first byte in memory after the end of the
storage occupied by the object, respectively</ins>
<del>or a null pointer (4.10)</del>.
<del>
If an object of type T is located at an address A, a pointer of type cv T* whose value is the
address A is said to point to that object, regardless of how the value was obtained.
</del>
[&nbsp;<em>Note</em>:
<del>For instance, the address one</del> <ins>A pointer</ins> past the
end of an <del>array</del> <ins>object</ins> (5.7)
<del>would be</del>
<ins>is not</ins>
considered to point to an unrelated object of the
<del>array's element</del> <ins>object's</ins> type
that might be located at that address.
<del>
There are further restrictions on pointers to
objects with dynamic storage duration; see 3.7.4.3.
</del>
<ins>
A pointer acquires an invalid pointer value
when the storage it denotes
reaches the end of its storage duration; see [basic.stc].
</ins>
&mdash;&nbsp;<em>end note</em>&nbsp;]
<ins>For purposes of pointer arithmetic (5.7 expr.add) and comparison (5.9 expr.rel, 5.10 expr.eq),
a pointer that points past the end of the last element of an array <ins><tt>x</tt></ins> of <i>n</i> elements is considered
to point to a hypothetical element <tt>x[n]</tt>.</ins>
The value representation of pointer types is implementation-defined.
Pointers to cv-qualified and cv-unqualified versions (3.9.3)
of layout-compatible types
shall have the same value representation and alignment requirements (3.11).
[&nbsp;<em>Note</em>: &hellip; &mdash;&nbsp;<em>end note</em>&nbsp;]
</blockquote>

<p>
Change in 5.7 (expr.add) paragraph 4:
</p>

<blockquote>
When an expression that has integral type is added to or subtracted from a pointer,
the result has the type of the pointer operand.

<del>
If the pointer operand points to an element of an array object [Footnote],
and the array is large enough,
the result points to an element offset from the original element
such that the difference of the subscripts
of the resulting and original array elements
equals the integral expression.

In other words, if
</del><ins>If</ins>
the expression <tt>P</tt>
points to <del>the <em>i</em>-th</del> element <ins><tt>x[i]</tt></ins>
of an array object <ins><tt>x</tt> with <em>n</em> elements
[&nbsp;<i>Footnote</i>:
An object that is not an array element is considered to belong to a single-element array for this purpose; see 5.3.1.
A pointer past the end of the last element of an array <ins><tt>x</tt></ins> of <i>n</i> elements
is considered to point to a hypothetical element <tt>x[n]</tt> for this purpose; see 3.9.2.
]</ins>,
the expressions

<del><tt>(P)+N</tt> (equivalently, <tt>N+(P)</tt>) and <tt>(P)-N</tt></del>

<ins><tt>P + J</tt> and <tt>J + P</tt></ins>

(where <tt><del>N</del><ins>J</ins></tt> has the value <i><del>n</del><ins>j</ins></i>)
point to<del>, respectively, the</del>
<em>x[i + j]</em><del>-th and <em>x[i - j]</em>-th elements
of the array object, provided they exist</del>
<ins>if 0 &#8804; <em>i + j</em> &lt; <em>n</em>,
and point past the end of <tt>x[n - 1]</tt> if <em>i + j</em> = <em>n</em></ins><del>
Moreover, if the expression P points to the last element of an array object,
the expression (P)+1 points one past the last element of the array object, and if the expression Q points
one past the last element of an array object, the expression (Q)-1 points to the last element of the array
object. If both the pointer operand and the result point to elements of the same array object, or one past
the last element of the array object, the evaluation shall not produce an overflow</del>; otherwise, the behavior is
undefined.

<ins>Likewise, the expression <tt>P - J</tt> points to <tt>x[i - j]</tt>
if 0 &#8804; <em>i - j</em> &lt; <em>n</em>,
and point past the end of <tt>x[n - 1]</tt> if <em>i - j</em> = <em>n</em>; otherwise, the behavior is undefined.
</ins>
</blockquote>

<p>
Change in 5.7 (expr.add) paragraph 5:
</p>

<blockquote>
When two pointers to elements of the same array object are subtracted,
<del>
the result is the difference of the subscripts of the two array elements.
The</del> <ins>the</ins>
type of the result is an implementation-defined signed integral type;
this type shall be the same type that is defined as <tt>std::ptrdiff_t</tt> in the <tt>&lt;cstddef&gt;</tt> header (18.2).
<del>
As with any other arithmetic overflow, if the result does not fit in the space provided, the behavior is undefined.
In other words, if
</del> <ins>If</ins>
the expressions <tt>P</tt> and <tt>Q</tt> point to, respectively,
<del>the i-th and j-th</del> elements <ins><tt>x[i]</tt> and <tt>x[j]</tt></ins> of <del>an</del><ins>the same</ins> array object <tt>x</tt>,
the expression <del>(P)-(Q)</del><ins>P - Q</ins> has the value <i>i - j</i>
<del>provided the value fits in an object of type <tt>std::ptrdiff_t</tt>.</del>
<ins>; otherwise, the behavior is undefined.
[&nbsp;<em>Note</em>:
If the value <i>i - j</i> is not in the range of representable values of type <tt>std::ptrdiff_t</tt>, the behavior is undefined.
&mdash;&nbsp;<em>end note</em>&nbsp;]</ins>
<del>
Moreover, if the expression P points either to an element of an array object or one past the last element of
an array object, and the expression Q points to the last element of the same array object, the expression
((Q)+1)-(P) has the same value as ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the
expression P points one past the last element of the array object, even though the expression (Q)+1 does not
point to an element of the array object. Unless both pointers point to elements of the same array object, or
one past the last element of the array object, the behavior is undefined.
[Footnote: Another way to approach pointer arithmetic &hellip;]
</del>
</blockquote>

<p>
Change in 5.7 (expr.add) paragraph 7:
</p>

<blockquote>
If the value 0 is added to or subtracted from a <ins>null</ins> pointer value, the result <del>compares equal to the original pointer
value</del> <ins>is a null pointer value</ins>.
If two <del>pointers point to the same object or both point  past the end of the same array or both
are</del> null<del>, and the two</del> pointer<ins> value</ins>s are subtracted, the result compares equal to the value 0 converted to the type
<tt>std::ptrdiff_t.</tt>
</blockquote>

<p>
Change in 5.9 (expr.rel) paragraph 3:
</p>

<blockquote>
Comparing <ins>unequal</ins> pointers to objects
[&nbsp;<i>Footnote</i>:
An object that is not an array element is considered to belong to a single-element array for this purpose; see 5.3.1.
<ins>
A pointer past the end of the last element of an array of <i>n</i> elements
is considered to point to a hypothetical element <i>n</i> for this purpose; see 3.9.2.
</ins>
]
is defined as follows:
<ul>
<li>If two pointers point to different elements of the same array, or to subobjects thereof, the pointer to
the element with the higher subscript compares greater.
</li><li><del>If one pointer points to an element of an array, or to a subobject thereof, and another pointer points
one past the last element of the array, the latter pointer compares greater.</del>
</li><li>
If two pointers point to different non-static data members of the same object, or to subobjects of such
members, recursively, the pointer to the later declared member compares greater provided the two
members have the same access control (Clause 11) and provided their class is not a union.
</li></ul>
</blockquote>

<em>Drafting note: the change in 3.9.2 affects the semantics of an example like:</em>

  <pre>  struct S {
    char a;
    int b;
  } s;
  static_assert(static_cast&lt;void*&gt;(&amp;s.b) &gt;= static_cast&lt;void*&gt;(&amp;s.a + 1));</pre>

<em>Prior to this change, the result of the comparison was unspecified; now, it is required to hold, because <tt>&amp;s.a + 1</tt> is treated as a pointer to an element of the "array" <tt>s.a</tt>. The value of <tt>&amp;s.b &gt; &amp;s.a + 1</tt> is now specified and is <tt>false</tt> if and only if the pointers represent the same address.</em>

<p>
Add a new paragraph after 5.18 (expr.ass) paragraph 6:
</p>

<blockquote class="stdins">
When the left operand of an assignment operator involves a member access
expression (5.2.5 [expr.ref]) that nominates a union member, it may begin the
lifetime of that union member, as described below.
For an expression <tt>E</tt>, define the set <i>S(E)</i> of subexpressions
of <tt>E</tt> as follows:
<ul>
  <li>If <tt>E</tt> is of the form <tt>A.B</tt>,
  <i>S(E)</i> contains the elements of <i>S(A)</i>, and
  also contains <tt>A.B</tt> if <tt>B</tt> names a union member
  of a non-class, non-array type, or of a class type with a trivial default
  constructor that is not deleted, or an array of such types.
  <li>If <tt>E</tt> is of the form <tt>A[B]</tt> and
  is interpreted as a built-in array subscripting operator,
  <i>S(E)</i> is <i>S(A)</i> if <tt>A</tt> is of array type
  and is <i>S(B)</i> otherwise.
  <li>Otherwise, <i>S(E)</i> is empty.
</ul>
In an assignment expression of the form <tt>E1 = E2</tt>, for each
element <tt>Ei</tt> of <i>S(E1)</i>, if modification of <tt>Ei</tt>
would have undefined behavior under 3.8 [basic.life], an object of
the type of <tt>Ei</tt> is implicitly created with vacuous initialization in
the nominated storage; the beginning of its lifetime is sequenced after
the value computation of the left and right operands and before the
assignment.
[&nbsp;<em>Note</em>:<pre>
This ends the lifetime of the previously-active member of the union, if any
(3.8 [basic.life], 9.5 [class.union]).
&mdash;&nbsp;<em>end note</em>&nbsp;]
[&nbsp;<em>Example</em>:<pre>
union A { int x; int y[4]; };
struct B { A a; };
union C { B b; int k; };
int f() {
  C c;               // does not start lifetime of any union member
  c.b.a.y[3] = 4;    // creates objects to hold union members c.b and c.b.a.y
  return c.b.a.y[3]; // OK: c.b.a.y refers to newly created object (see 3.8 [basic.life])
}

struct X { const int a; int b; };
union Y { X x; int k; };
void g() {
  Y y = { { 1, 2 } }; // OK, y.x is active union member (9.2)
  int n = y.x.a;
  y.k = 4;   // OK: ends lifetime of y.x, y.k is active member of union
  y.x.b = n; // undefined behavior: y.x.b modified outside its lifetime,
             // union member y.x's lifetime does not start because X's
             // default constructor is deleted
}
</pre>
&mdash;&nbsp;<em>end example</em>&nbsp;]
</blockquote>

<p>
Add a new paragraph before 8.3.4 (dcl.array) paragraph 7:
</p>

<blockquote class="stdins">
The address of an array object is the same as the address of its first element.
[&nbsp;<em>Note</em>:&nbsp;
Nonetheless, if a pointer to the object
is cast to a pointer to
the type of its first subobject (or vice versa),
the resulting pointer does not point to the
subobject and cannot be used to access it.
&mdash;<em>end note</em>&nbsp;]
</blockquote>

<p>
Change in 9.2 class.mem paragraph 19:
</p>

<blockquote>
In a standard-layout union with an active member (9.5) of struct type T1, it is
permitted to read a non-static data member m of another union member of struct
type T2 provided m is part of the common initial sequence of T1 and T2<ins>;
the behavior is as if the corresponding member of T1 were nominated</ins>.
</blockquote>

<p>
Change in 9.2 class.mem paragraph 20:
</p>

<blockquote>
If a standard-layout class object
has any non-static data members,
its 
address is the same as the address of
its first non-static data member.
Otherwise,
its
address is the same as the address of
its first base class subobject (if any).
[&nbsp;<em>Note</em>:&nbsp;&hellip;&mdash;<em>end note</em>&nbsp;]
<ins>
[&nbsp;<em>Note</em>:&nbsp;
Nonetheless, if a pointer to the object
is cast to a pointer to
the type of its first subobject (or vice versa),
the resulting pointer does not point to the
subobject and cannot be used to access it.
&mdash;<em>end note</em>&nbsp;]
</ins>
</blockquote>

<p>
Change in 9.5 class.union paragraph 1, splitting it into two paragraphs:
</p>

<blockquote>
<p>
In a union,
<ins>a non-static data member is <em>active</em>
if its name refers to an object
whose lifetime has begun and has not ended ([basic.life]).</ins>
<del>at</del><ins>At</ins> most one of the non-static data members
<ins>of an object of union type</ins>
can be active at any
time, that is, the value of at most one of the non-static data members can be
stored in a union at any time.
[&nbsp;<em>Note</em>:
One special guarantee is made in order
to simplify the use of unions:
If a standard-layout union contains several
standard-layout structs that share a common initial sequence (9.2),
and if <ins>the active member of</ins> an object
of this standard-layout union type
<del>contains</del> <ins>is</ins> one of the standard-layout structs,
it is permitted to inspect the common initial sequence of any of <ins>the</ins>
standard-layout struct members; see 9.2.
&mdash;&nbsp;<em>end note</em>&nbsp;]

</p><p>
The size of a union is sufficient to contain the largest of its non-static data members.
Each non-static data member is allocated as if it were the sole member of a struct.
All non-static data members of a union object have the same address.
<ins>
[&nbsp;<em>Note</em>:&nbsp;
Nonetheless, if a pointer to a union object
is cast to a pointer to
the type of a non-static data member (or vice versa),
the resulting pointer does not point to the
subobject and cannot be used to access it.
&mdash;<em>end note</em>&nbsp;]
</ins>
</p></blockquote>

<p>
Add to 18.6 (support.dynamic) paragraph 1:
</p>

<blockquote class="stdins"><pre>namespace std {
  template &lt;class T&gt;
    constexpr T* launder(T* p) noexcept;
}
</pre></blockquote>

<p>
Add a new subclause under 18.6 (support.dynamic):
</p>

<blockquote class="stdins">
  <pre>template &lt;class T&gt; constexpr T* launder(T* p) noexcept;</pre>

<p><em>Requires:</em> <tt>p</tt> represents the address <tt>A</tt> of a byte in memory, and an object <tt>X</tt> that is within its lifetime and whose cv-unqualified type is similar to <tt>T</tt> is located at the address <tt>A</tt>.
</p><p><em>Returns:</em> A value of type <tt>T *</tt> that points to <tt>X</tt>.
</p><p><em>Note:</em> An invocation of this function may be used in a core constant expression whenever the value of its argument may be used in a core constant expression.
</p><p>
[&nbsp;<em>Example</em>:
</p><pre>struct X { const int n; };
X *p = new X{3};
const int a = p-&gt;n;
new (p) X{5};                     // p does not point to new object ([basic.life])
                                  // because X::n is const
const int b = p-&gt;n;               // undefined behavior
const int c = std::launder(p)-&gt;n; // ok
</pre>
&mdash;&nbsp;<em>end example</em>&nbsp;]
</blockquote>

<em>Drafting note: see N4303 for more background on the purpose and intended usage of this function.</em>

<p>
Change in 20.7.5 (ptr.align) paragraph 1:
</p>

<blockquote>
<i>Effects:</i>
If it is possible to fit <tt>size</tt> bytes of storage aligned by <tt>alignment</tt> into the buffer pointed to by
<tt>ptr</tt> with length <tt>space</tt>, the function updates <tt>ptr</tt> to
<del>point to</del> <ins>represent</ins> the first possible
address of such storage and decreases <tt>space</tt> by the number of bytes
used for alignment.
</blockquote>

<p>
Change in 20.7.5 (ptr.align) paragraph 2:
</p>

<blockquote>
<i>Requires:</i>
<ul><li><tt>alignment</tt> shall be a power of two
    </li><li><tt>ptr</tt> shall <del>point to</del><ins>represent the address of</ins> contiguous storage of at least <tt>space</tt> bytes
</li></ul>
</blockquote>
 

</body></html>
