Compiler would try to substute all entries of constant with its value.
It still a variable, you can take its address, pass it as pointer, or have other code "outside" access it. So it is possible to other code which do not know its value in compile time still can use it.
If constant has internal linkage and all access happens in compile time it can be completely optimized out.
Besides, you claim that the compiler does place 10 to various places, so your code should contain sizeof(10). That is a valid question, whether you have memory for it or not. How many bytes would I need if I had to store ...
sizeof(a) tells us how many bytes would be used by the object representation of an object of type int.
It tells us nothing about whether the variable a has been optimised away or not.