[clang-tools-extra] Update identifier-length.rst (PR #93467)

Mattan Elkaim via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 05:48:01 PDT 2024


https://github.com/mattanelkaim created https://github.com/llvm/llvm-project/pull/93467

Swapped code blocks of parameter and variable, which have been confused

>From ec5fb34d5df2b82d0fef468b413fb0422311ecc5 Mon Sep 17 00:00:00 2001
From: Mattan Elkaim <73639004+mattanelkaim at users.noreply.github.com>
Date: Mon, 27 May 2024 15:47:23 +0300
Subject: [PATCH] Update identifier-length.rst

Swapped code blocks of parameter and variable, which have been confused
---
 .../checks/readability/identifier-length.rst           | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-length.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-length.rst
index 44d97f7b363bf..271970c292c8f 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-length.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-length.rst
@@ -28,10 +28,7 @@ The following options are described below:
 
     .. code-block:: c++
 
-         int doubler(int x)   // warns that x is too short
-         {
-            return 2 * x;
-         }
+      int i = 42;    // warns that 'i' is too short
 
     This check does not have any fix suggestions in the general case since
     variable names have semantic value.
@@ -50,7 +47,10 @@ The following options are described below:
 
     .. code-block:: c++
 
-      int i = 42;    // warns that 'i' is too short
+         int doubler(int x)   // warns that x is too short
+         {
+            return 2 * x;
+         }
 
     This check does not have any fix suggestions in the general case since
     variable names have semantic value.



More information about the cfe-commits mailing list