This should be rejected, but all of gcc, clang, msvc and EDG are totally cool with it: constexpr bool test2() { int* p = new int[2]; int* x = p; delete[] p; p = new int[4]; void* v = nullptr; for (int i = 0; i < 2; ++i) v = x++; delete[] p; return v != p; } static_assert( test2() ); The other compilers give an error if x is increment more than twice, but GCC let's you keep incrementing it.
https://godbolt.org/z/f1jxvMvdz
Similar to Bug 111242 but here the pointer has already been deallocated.