For

 

int i = 0;

const i;

std::cout << &i << std::endl;

 

 

Would the compiler be allowed to optimize out the non-const phase of i and put it into read-only-memory?

 

 

For

 

int i = 0;

std::cout << &i << std::endl;

const i;

std::cout << &i << std::endl;

 


Would the compiler be allowed to relocate i between non-const memory and read-only-memory and print out two different addresses?