The compiler sees the code and so do you. While type info is available, do you really need it?
How about:
1 2 3 4 5 6 7 8
using myInt = int; // the type is defined in one place
myInt *p;
myInt *str = new myInt[512]{};
delete [] str; str = nullptr;
// or better yet:
std::vector<myInt> str( 512 );