summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst
new file mode 100644
index 00000000000..b679799758c
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability-static-accessed-through-instance.rst
@@ -0,0 +1,30 @@
+.. title:: clang-tidy - readability-static-accessed-through-instance
+
+readability-static-accessed-through-instance
+============================================
+
+Checks for member expressions that access static members through instances, and
+replaces them with uses of the appropriate qualified-id.
+
+Example:
+
+The following code:
+
+.. code-block:: c++
+
+ struct C {
+ static void foo();
+ static int x;
+ };
+
+ C *c1 = new C();
+ c1->foo();
+ c1->x;
+
+is changed to:
+
+.. code-block:: c++
+
+ C::foo();
+ C::x;
+
OpenPOWER on IntegriCloud