Alright, I think we all agree that what happens with the following code is undefined, depending on what is passed,
void deleteForMe(int* pointer)
int* arr = new int;
int* num = new int(2);
The compiler doesn't know it's an array, it's trusting the programmer. Deleting a pointer to a single
delete  would result in undefined behavior. Your second
main() example is unsafe, even if it doesn't immediately crash.
The compiler does have to keep track of how many objects need to be deleted somehow. It may do this by over-allocating enough to store the array size. For more details, see the C++ Super FAQ.