[llvm-branch-commits] [clang-tools-extra] [clang-doc][nfc] Use static declarations to enforce internal linkage (PR #198072)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 22 10:46:38 PDT 2026


https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/198072

>From f64b4cbf89a0e81334babb831c02961d286bfccc Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Sat, 16 May 2026 02:04:55 +0000
Subject: [PATCH] [clang-doc][nfc] Use static declarations to enforce internal
 linkage

---
 clang-tools-extra/clang-doc/YAMLGenerator.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
index 88102e9c51d5f..3d2bb97335b6f 100644
--- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
@@ -33,8 +33,8 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(BaseRecordInfo)
 namespace llvm {
 
 template <typename T>
-bool operator==(const llvm::simple_ilist<T> &LHS,
-                const llvm::simple_ilist<T> &RHS) {
+static bool operator==(const llvm::simple_ilist<T> &LHS,
+                       const llvm::simple_ilist<T> &RHS) {
   auto LIt = LHS.begin(), LEnd = LHS.end();
   auto RIt = RHS.begin(), REnd = RHS.end();
   for (; LIt != LEnd && RIt != REnd; ++LIt, ++RIt) {
@@ -45,8 +45,8 @@ bool operator==(const llvm::simple_ilist<T> &LHS,
 }
 
 template <typename T>
-bool operator!=(const llvm::simple_ilist<T> &LHS,
-                const llvm::simple_ilist<T> &RHS) {
+static bool operator!=(const llvm::simple_ilist<T> &LHS,
+                       const llvm::simple_ilist<T> &RHS) {
   return !(LHS == RHS);
 }
 



More information about the llvm-branch-commits mailing list