This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2026-07-26


3209. Pointer interconvertibility with bit-fields

Section: 6.9.5  [basic.compound]     Status: open     Submitter: Jay Ghiron     Date: 2026-06-07

(From submission #916.)

Preventing the formation of pointers to bit-fields is inconsistently enforced. Also, it appears the wording makes v and v.x pointer-interconvertible in the following example, which is undesirable:

struct {
  int : 1;
  int x;
} v;

Possible resolution:

  1. Change in 6.9.5 [basic.compound] bullet 3.1 as follows:

    ... Every value of pointer type is one of the following:
    • a pointer to an a non-bit-field object or to a function (the pointer is said to point to the object or function), or
    • a pointer past the end of an a non bit-field object (7.6.6 [expr.add]), or
    • ...
  2. Change in 6.9.5 [basic.compound] paragraph 6 as follows:

    Two non-bit-field objects a and b are pointer-interconvertible if
    • they are the same object, or
    • one is a union object and the other is a non-static data member of that object (11.5 [class.union]), or
    • one is a standard-layout class object and the other is the first non-static data member of that object or any base class subobject of that object (11.4 [class.mem]), where the member is not declared after any bit-field (11.4.10 [class.bit]), or
    • there exists an object c such that a and c are pointer-interconvertible, and c and b are pointer-interconvertible.
    If two objects are pointer-interconvertible, then they have the same address, and it is possible to obtain a pointer to one from a pointer to the other via a reinterpret_cast (7.6.1.10 [expr.reinterpret.cast]). ...
  3. Change in 7.6.2.2 [expr.unary.op] paragraph 3 as follows:

    The operand of the unary & operator shall be an a non-bit-field lvalue of some type T. ...
  4. Change in 7.6.2.2 [expr.unary.op] paragraph 5 as follows:

    If & is applied to an lvalue of incomplete class type and the complete type declares operator&(), it is unspecified whether the operator has the built-in meaning or the operator function is called. The operand of & shall not be a bit-field.
  5. Change in 11.4.10 [class.bit] paragraph 3 as follows:

    [ Note: The address-of operator & shall not cannot be applied to a bit-field (7.6.2.2 [expr.unary.op]), so ; there are no pointers to bit-fields (6.9.5 [basic.compound]). A non-const reference shall not cannot bind directly to a bit-field (9.5.4 [dcl.init.ref]). -- end note]