[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / readability / static-accessed-through-instance.rst
blob879b87c2feb5a245785fc2c48e014633781d9d71
1 .. title:: clang-tidy - readability-static-accessed-through-instance
3 readability-static-accessed-through-instance
4 ============================================
6 Checks for member expressions that access static members through instances, and
7 replaces them with uses of the appropriate qualified-id.
9 Example:
11 The following code:
13 .. code-block:: c++
15   struct C {
16     static void foo();
17     static int x;
18   };
20   C *c1 = new C();
21   c1->foo();
22   c1->x;
24 is changed to:
26 .. code-block:: c++
28   C *c1 = new C();
29   C::foo();
30   C::x;