== Why is this an issue?

Since {cpp}11, declaring a variable, class, or function in an unnamed ``++namespace++`` gives it internal linkage. Similarly, marking a declaration ``++static++`` also gives it internal linkage. Because both mechanisms have the same effect (although ``++static++`` has a narrower application) using them together is clearly redundant.


=== Noncompliant code example

[source,cpp]
----
namespace {
  static int i = 3;  // Noncompliant
}
----


=== Compliant solution

[source,cpp]
----
namespace {
  int i = 3;
}
----


== Resources

* ISO/IEC 14882:2011 §3.5 paragraph 4

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Remove this redundant use of "static".


=== Highlighting

``++static++``


endif::env-github,rspecator-view[]
