[clang] [clang] fix(92755): clang/include/clang/AST/Redeclarable.h: 4 * Function parameter should be passed by const reference (PR #92963)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 23:51:35 PDT 2024


https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/92963

>From f33697ce241213136a8d34c2cc32c68f8f827d6a Mon Sep 17 00:00:00 2001
From: Oleksandr T <oleksandr.tarasiuk at outlook.com>
Date: Tue, 21 May 2024 22:56:06 +0300
Subject: [PATCH] fix(92755): use const references for operator== and
 operator!= overloads

---
 clang/include/clang/AST/Redeclarable.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/AST/Redeclarable.h b/clang/include/clang/AST/Redeclarable.h
index 091bb886f2d49..74ccd74ed60d6 100644
--- a/clang/include/clang/AST/Redeclarable.h
+++ b/clang/include/clang/AST/Redeclarable.h
@@ -281,10 +281,10 @@ class Redeclarable {
       return tmp;
     }
 
-    friend bool operator==(redecl_iterator x, redecl_iterator y) {
+    friend bool operator==(const redecl_iterator &x, const redecl_iterator &y) {
       return x.Current == y.Current;
     }
-    friend bool operator!=(redecl_iterator x, redecl_iterator y) {
+    friend bool operator!=(const redecl_iterator &x, const redecl_iterator &y) {
       return x.Current != y.Current;
     }
   };



More information about the cfe-commits mailing list