[clang-tools-extra] [clang-tidy][doc] Document that Class* options apply only to static members (PR #227600)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 30 04:47:46 PDT 2026
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/227600
>From 27f7a7b542d496d63f5ee8fbdb1bf353c56f3b8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= <carlos.galvez at zenseact.com>
Date: Wed, 30 Sep 2026 08:09:22 +0000
Subject: [PATCH] [clang-tidy][doc] Document that Class* options apply only to
static members
This appears to be the intention based on the code:
if (Decl->isStatic() && NamingStyles[SK_ClassMethod])
return SK_ClassMethod;
Fix a couple examples accordingly.
Fixes #227319
---
.../checks/readability/identifier-naming.md | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.md b/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.md
index 8e230965690b6..d42384f310860 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.md
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.md
@@ -543,28 +543,28 @@ public:
(readability-identifier-naming-class-constexpr-case)=
```{option} ClassConstexprCase
-When defined, the check will ensure class `constexpr` names conform to
+When defined, the check will ensure class `static constexpr` names conform to
the selected casing.
```
(readability-identifier-naming-class-constexpr-prefix)=
```{option} ClassConstexprPrefix
-When defined, the check will ensure class `constexpr` names will add the
+When defined, the check will ensure class `static constexpr` names will add the
prefix with the given value (regardless of casing).
```
(readability-identifier-naming-class-constexpr-ignored-regexp)=
```{option} ClassConstexprIgnoredRegexp
-Identifier naming checks won't be enforced for class `constexpr` names
+Identifier naming checks won't be enforced for class `static constexpr` names
matching this regular expression.
```
(readability-identifier-naming-class-constexpr-suffix)=
```{option} ClassConstexprSuffix
-When defined, the check will ensure class `constexpr` names will add the
+When defined, the check will ensure class `static constexpr` names will add the
suffix with the given value (regardless of casing).
```
@@ -598,35 +598,35 @@ After:
```c++
class FOO {
public:
- static const int pre_class_constexpr_post;
+ static constexpr int pre_class_constexpr_post;
};
```
(readability-identifier-naming-class-constant-case)=
```{option} ClassConstantCase
-When defined, the check will ensure class constant names conform to the
+When defined, the check will ensure class static constant names conform to the
selected casing.
```
(readability-identifier-naming-class-constant-prefix)=
```{option} ClassConstantPrefix
-When defined, the check will ensure class constant names will add the
+When defined, the check will ensure class static constant names will add the
prefix with the given value (regardless of casing).
```
(readability-identifier-naming-class-constant-ignored-regexp)=
```{option} ClassConstantIgnoredRegexp
-Identifier naming checks won't be enforced for class constant names
+Identifier naming checks won't be enforced for class static constant names
matching this regular expression.
```
(readability-identifier-naming-class-constant-suffix)=
```{option} ClassConstantSuffix
-When defined, the check will ensure class constant names will add the
+When defined, the check will ensure class static constant names will add the
suffix with the given value (regardless of casing).
```
@@ -667,28 +667,28 @@ public:
(readability-identifier-naming-class-member-case)=
```{option} ClassMemberCase
-When defined, the check will ensure class member names conform to the
+When defined, the check will ensure class static member names conform to the
selected casing.
```
(readability-identifier-naming-class-member-prefix)=
```{option} ClassMemberPrefix
-When defined, the check will ensure class member names will add the
+When defined, the check will ensure class static member names will add the
prefix with the given value (regardless of casing).
```
(readability-identifier-naming-class-member-ignored-regexp)=
```{option} ClassMemberIgnoredRegexp
-Identifier naming checks won't be enforced for class member names
+Identifier naming checks won't be enforced for class static member names
matching this regular expression.
```
(readability-identifier-naming-class-member-suffix)=
```{option} ClassMemberSuffix
-When defined, the check will ensure class member names will add the
+When defined, the check will ensure class static member names will add the
suffix with the given value (regardless of casing).
```
@@ -729,21 +729,21 @@ public:
(readability-identifier-naming-class-method-case)=
```{option} ClassMethodCase
-When defined, the check will ensure class method names conform to the
+When defined, the check will ensure class static method names conform to the
selected casing.
```
(readability-identifier-naming-class-method-prefix)=
```{option} ClassMethodPrefix
-When defined, the check will ensure class method names will add the
+When defined, the check will ensure class static method names will add the
prefix with the given value (regardless of casing).
```
(readability-identifier-naming-class-method-ignored-regexp)=
```{option} ClassMethodIgnoredRegexp
-Identifier naming checks won't be enforced for class method names
+Identifier naming checks won't be enforced for class static method names
matching this regular expression.
```
@@ -767,7 +767,7 @@ Before:
```c++
class FOO {
public:
- int CLASS_MEMBER();
+ static int CLASS_MEMBER();
};
```
@@ -776,7 +776,7 @@ After:
```c++
class FOO {
public:
- int pre_class_member_post();
+ static int pre_class_member_post();
};
```
More information about the cfe-commits
mailing list