[llvm] [llvm][docs] Clarify lambda naming in CodingStandards.md (PR #206652)

Timm Baeder via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 23:11:12 PDT 2026


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/206652

Clarify that the same naming conventions apply for lambdas and for function names.

>From d4aea73f1e0284ceb970b3cc4c5bc7439e55a0b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 30 Jun 2026 08:10:00 +0200
Subject: [PATCH] [llvm][docs] Clarify lambda naming in CodingStandards.md

---
 llvm/docs/CodingStandards.md | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/llvm/docs/CodingStandards.md b/llvm/docs/CodingStandards.md
index aac3f32c9c8de0..969ee0f6aa8786 100644
--- a/llvm/docs/CodingStandards.md
+++ b/llvm/docs/CodingStandards.md
@@ -1150,9 +1150,12 @@ In general, names should be in camel case (e.g. `TextFileReader` and
   be camel case, and start with an upper-case letter (e.g. `Leader` or
   `Boats`).
 
-* **Function names** should be verb phrases (as they represent actions), and
-  command-like function should be imperative.  The name should be camel case,
-  and start with a lowercase letter (e.g. `openFile()` or `isFoo()`).
+* **Function names and lambda names** should be verb phrases (as they
+  represent actions), and command-like function should be imperative.
+  The name should be camel case, and start with a lowercase
+  letter (e.g. `openFile()` or `isFoo()`). Since lambdas are used as
+  functions (but are local variables of class type), we use the same
+  rules for function and lambda names.
 
 * **Enum declarations** (e.g. `enum Foo {...}`) are types, so they should
   follow the naming conventions for types.  A common use for enums is as a



More information about the llvm-commits mailing list