Annex F (informative) Core undefined behavior [ub]

F.3 [expr]: Expressions [ub.expr]

F.3.32[ub:expr.add.not.similar]
Specified in: [expr.add]

For addition or subtraction of two expressions P and Q, if P or Q have type “pointer to cv T”, where T and the array element type are not similar ([conv.rval]), the behavior is undefined.
[Example 1: struct S { int i; }; struct T : S { double d; }; void f(const S* s, std::size_t count) { for (const S* end = s + count; s != end; ++s) { // undefined behavior, T is not similar to S but s points to a T[] /* ... */ } } int main() { T test[5]; f(test, 5); } — end example]