The value computation of i++ results in integer overflow irrespective of whether the computed value is used or if that object cease to exist right after the next sequence point; sequence point or storage duration of the object is irrelevant whether there's an undefined behaviour here.