linux-packaging-mono/external/llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability-static-definition-in-anonymous-namespace.rst
Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

19 lines
577 B
ReStructuredText

.. title:: clang-tidy - readability-static-definition-in-anonymous-namespace
readability-static-definition-in-anonymous-namespace
====================================================
Finds static function and variable definitions in anonymous namespace.
In this case, ``static`` is redundant, because anonymous namespace limits the
visibility of definitions to a single translation unit.
.. code-block:: c++
namespace {
static int a = 1; // Warning.
static const b = 1; // Warning.
}
The check will apply a fix by removing the redundant ``static`` qualifier.