I was given the following as an interview question:
class A
{
public:
void fun()
{
std::cout << "fun" << std::endl;
It's undefined behavior, so anything might happen.
A possible result would be that it just prints "fun" since the method doesn't access any member variables of the object it is called on (the memory where the object supposedly lives doesn't need to be accessed, so access violations don't necessarily occur).