[clang] [Clang] use const references for function parameters in operator== and operator!= overloads in Redeclarable.h (PR #92963)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 11:16:16 PDT 2024


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

>From c94e7cbe04c0f23094a7f2a3d2a7cbd103750301 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] [Clang] use const references for function parameters in
 operator== and operator!= overloads in Redeclarable.h

---
 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