What happens to the reference in function parameter, if it gets destroyed when the function returns, then how const int *i is still a valid pointer?

const int* func(const int &x = 5)
{
    return &x;
}


int main()
{
    const int *i = func();
}
Edit
Report