Skip to content

Commit 96e7f35

Browse files
authored
Merge pull request itanium-cxx-abi#51 from zygoloid/patch-1
Fix description of empty classes to handle anonymous bit-fields of no…
2 parents 685a656 + 1402f09 commit 96e7f35

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

abi.html

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ <h3><a href="#definitions"> 1.1 Definitions </a></h3>
163163
<p>
164164
<dt> <i>empty class</i> </dt>
165165
<dd>
166-
A class with no non-static data members other than zero-width bitfields,
166+
A class with no non-static data members,
167+
no unnamed bit-fields other than zero-width bit-fields,
167168
no virtual functions, no virtual base classes,
168169
and no non-empty non-virtual proper base classes.
169170

@@ -231,7 +232,7 @@ <h3><a href="#definitions"> 1.1 Definitions </a></h3>
231232
A class that contains a virtual pointer, but no other data except
232233
(possibly) virtual bases. In particular, it:
233234
<ul>
234-
<li> has no non-static data members other than zero-width bitfields,
235+
<li> has no non-static data members and no non-zero-width unnamed bit-fields,
235236
<li> has no direct base classes that are not either empty, nearly empty,
236237
or virtual,
237238
<li> has at most one non-virtual, nearly empty direct base class, and
@@ -269,8 +270,8 @@ <h3><a href="#definitions"> 1.1 Definitions </a></h3>
269270
In general, a type is considered a POD for the purposes of layout if
270271
it is a POD type (in the sense of ISO C++ [basic.types]). However, a
271272
POD-struct or POD-union (in the sense of ISO C++ [class]) with a
272-
bitfield member whose declared width is wider than the declared type
273-
of the bitfield is not a POD for the purpose of layout. Similarly, an
273+
bit-field whose declared width is wider than the declared type
274+
of the bit-field is not a POD for the purpose of layout. Similarly, an
274275
array type is not a POD for the purpose of layout if the element type
275276
of the array is not a POD for the purpose of layout. Where references
276277
to the ISO C++ are made in this paragraph, the Technical Corrigendum 1
@@ -779,13 +780,13 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
779780
<p>
780781
For each data component D (first the primary base of C, if any, then
781782
the non-primary, non-virtual direct base classes in declaration order,
782-
then the non-static data members and unnamed bitfields in declaration
783+
then the non-static data members and unnamed bit-fields in declaration
783784
order), allocate as follows:
784785

785786
<ol type=1>
786787

787788
<p>
788-
<li> If D is a (possibly unnamed) bitfield whose declared type is
789+
<li> If D is a (possibly unnamed) bit-field whose declared type is
789790
<code>T</code> and whose declared width is <code>n</code> bits:
790791

791792
<p>
@@ -796,13 +797,13 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
796797
<p>
797798
<li>
798799
If <code>sizeof(T)*8 >= n</code>,
799-
the bitfield is allocated as required by the underlying C psABI,
800-
subject to the constraint that a bitfield is never placed in the
800+
the bit-field is allocated as required by the underlying C psABI,
801+
subject to the constraint that a bit-field is never placed in the
801802
tail padding of a base class of C.
802803

803804
<p>
804805
If dsize(C) > 0, and the byte at offset dsize(C) - 1 is
805-
partially filled by a bitfield, and that bitfield is also a
806+
partially filled by a bit-field, and that bit-field is also a
806807
data member declared in C (but not in one of C's proper base
807808
classes), the next available bits are the unfilled bits at
808809
offset dsize(C) - 1. Otherwise, the next available bits are at
@@ -816,10 +817,10 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
816817
If <code>sizeof(T)*8 < n</code>,
817818
let T' be the largest integral POD type with
818819
<code>sizeof(T')*8 <= n</code>.
819-
The bitfield is allocated starting at the next offset aligned
820+
The bit-field is allocated starting at the next offset aligned
820821
appropriately for T', with length n bits.
821822
The first <code>sizeof(T)*8</code> bits are used to hold the
822-
value of the bitfield,
823+
value of the bit-field,
823824
followed by <code>n - sizeof(T)*8</code> bits of padding.
824825
<p>
825826
Update align(C) to max (align(C), align(T')).
@@ -828,7 +829,7 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
828829
<p>
829830
In either case,
830831
update dsize(C) to include the last byte
831-
containing (part of) the bitfield,
832+
containing (part of) the bit-field,
832833
and update sizeof(C) to max(sizeof(C),dsize(C)).
833834

834835
<p>
@@ -6084,7 +6085,7 @@ <h2><a name="revisions">Appendix R: Revision History</a></h2>
60846085
Reverse treatment of ambiguous arguments to __cxa_demangle (3.4).</p>
60856086

60866087
<p class="revision"><span class="date">[041118]</span>
6087-
Clarify the layout of bitfields.</p>
6088+
Clarify the layout of bit-fields.</p>
60886089

60896090
<p class="revision"><span class="date">[041025]</span>
60906091
Indicate that the TC1 definition of POD is intended in the section
@@ -6327,20 +6328,20 @@ <h2><a name="revisions">Appendix R: Revision History</a></h2>
63276328
Add thunk definition.
63286329
Revise inheritance graph order definition.
63296330
Fix member function pointer description (no division by two).
6330-
Move bitfield allocation description (much modified)
6331+
Move bit-field allocation description (much modified)
63316332
to the non-virtual-base allocation description.
63326333
Replace virtual function calling convention description.</p>
63336334

63346335
<p class="revision"><span class="date">[000228]</span>
63356336
Add thunk definition.
63366337
Revise inheritance graph order definition.
63376338
Fix member function pointer description (no division by two).
6338-
Move bitfield allocation description (much modified)
6339+
Move bit-field allocation description (much modified)
63396340
to the non-virtual-base allocation description.
63406341
Replace virtual function calling convention description.</p>
63416342

63426343
<p class="revision"><span class="date">[000217]</span>
6343-
Add excess-size bitfield specification.
6344+
Add excess-size bit-field specification.
63446345
Add namespace/header section.
63456346
Touch up array new cookies.
63466347
Remove construction vtable example to new file.

0 commit comments

Comments
 (0)