Seem it's a bug in n3126.pdf

K

kuangye

/////bug location:
n3126.pdf
page: 8
section:1.8 The C++ object model
paragraph:5

////the following are extract from n3126.pdf, page:8
///but I add some notes to indicate my question.
//

If a complete object, a data member (9.2), or an array element is of
class type, its type is considered the most derived class, to
distinguish it from the class type of any base class subobject; an
object of a most derived class type or of a non-class type is called a
most derived object.

/////the following "Unless it is a bit-field (9.6)" seems to be
redundant and misleading.
////Since a bit-field can't be "a most derived object"
Unless it is a bit-field (9.6), a most derived object shall have a non-
zero size and shall occupy one or more bytes of storage. Base class
subobjects may have zero size. An object of trivially copyable or
standard-layout type (3.9) shall occupy contiguous bytes of storage.

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 distinct objects that are neither bit-fields nor base
class subobjects of zero size shall have distinct addresses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top