I'm testing some C++ code with -std=c++11
. I noticed a warning I had not seen before:
'register' storage class specifier is deprecated
What does the standard say about this (other than its deprecated)?
Is it implementation defined?
Will compilers take it as a hint and try to put the value in a register?
Will this eventually lead to a compile failure?
Perhaps something else?
C++11, [dcl.stc]:
There is a proposal to remove the
register
keyword as a storage specifier, while reserving it as a keyword: Remove Deprecated Use of theregister
Keyword (n4340). This may or may not be implemented in C++1z (tentative C++17); it would pose challenges for compatibility with C, whereregister
still has semantic effect (a Cregister
variable or parameter cannot have its address taken or be subject to array-to-pointer decay).