According to this answer, namespace-scoped static variables were undeprecated in C++11. That is, they were deprecated in C++03, because anonymous namespaces were considered
This is a more in-depth explanation.
Although 7.3.1.1 [namespace.unnamed] states that the use of the static keyword for declaring variables in namespace scope is deprecated because the unnamed namespace provides a superior alternative, it is unlikely that the feature will be removed at any point in the foreseeable future, especially in light of C compatibility concerns. The Committee should consider removing the deprecation.
One issue I know is that anonymous namespaces can't specialize templates outside of the namespace block. This is why inline namespace
was introduced, although static
works too. Also, static
plays much nice with macros.