Created on 2026-06-07.00:00:00 last changed 2 days ago
Possible resolution:
Change in 6.9.4 [basic.compound] bullet 3.1 as follows:
... Every value of pointer type is one of the following:
- a pointer to
ana non-bit-field object or to a function (the pointer is said to point to the object or function), or- ...
Change in 6.9.4 [basic.compound] paragraph 6 as follows:
Two non-bit-field objects a and b are pointer-interconvertible ifIf 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]). ...
- 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.
Change in 7.6.2.2 [expr.unary.op] paragraph 3 as follows:
The operand of the unary & operator shall beana non-bit-field lvalue of some type T. ...
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.
Change in 11.4.10 [class.bit] paragraph 3 as follows:
[ Note: The address-of operator &shall notcannot be applied to a bit-field (7.6.2.2 [expr.unary.op]), so; there are no pointers to bit-fields (6.9.4 [basic.compound]). A non-const referenceshall notcannot bind to a bit-field (9.5.4 [dcl.init.ref]). -- end note]
(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;
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-29 21:51:14 | admin | set | messages: + msg8625 |
| 2026-06-07 00:00:00 | admin | create | |