static
inside an anonymous namespace is redundant CXX-C2021Using the storage specifier static
inside an anonymous namespace is redundant. The anonymous namespace already limits the visibility of definitions to a single translation unit.
To fix the issue, simply remove the static
specifier from the definitions inside the anonymous namespace. This will make the code more concise.
namespace {
static int count = 0; // Redundant use of static
}
### Recommended
``cpp
namespace {
int count = 0;
}