I'm using N3797 working draft.
Section 5.7/1 says:
[...] For addition, either both operands shall have arithmetic or unscoped enumeration type, or one operand shall be a pointer to a completely-defined object type and the other shall have integral or unscoped enumeration type.
Ok. But consider the rule from the section 3.7.4.3/3:
— the result of an additive or bitwise operation, one of whose operands is an integer representation of a safely-derived pointer value
P
, if that result converted byreinterpret_cast<void*>
would compare equal to a safely-derived pointer computable fromreinterpret_cast<void*>(P)
.
That is, we cannot apply pointer arithmetic to a pointer to void
. Could you possibly provide an example reflecting the rule from 3.7.4.3?
The similiar question doesn't provide a suitable example, because the pointer to void arithmetic appers here.