It's still weird to me that you can declare an array with the register keyword.
Then it (understandably) becomes UB to attempt to get the pointer.
(It also probably isn't stored in a register, since the keyword is just asking the compiler nicely.)
The meaning of the 'register' keyword has changed over time to just "it's illegal to take the address of this item":
https://www.godbolt.org/z/TKq9rWzP1
Don't know what's the idea behind not allowing to take the address of a value though.
The meaning of the 'register' keyword has changed over time to just "it's illegal to take the address of this item":
https://www.godbolt.org/z/TKq9rWzP1
Don't know what's the idea behind not allowing to take the address of a value though.