Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #92755

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels May 21, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented May 21, 2024

@llvm/pr-subscribers-clang

Author: Oleksandr T. (a-tarasyuk)

Changes

Fixes #92755


Full diff: https://github.com/llvm/llvm-project/pull/92963.diff

1 Files Affected:

  • (modified) clang/include/clang/AST/Redeclarable.h (+2-2)
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;
     }
   };

@a-tarasyuk a-tarasyuk changed the title [clang] fix(92755): clang/include/clang/AST/Redeclarable.h: 4 * Function parameter should be passed by const reference [Clang] use const references for function parameters in operator== and operator!= overloads in Redeclarable.h Jun 15, 2024
Copy link
Contributor

@zyn0217 zyn0217 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explicitly say NFC in the commit title. Otherwise, LGTM

@a-tarasyuk a-tarasyuk changed the title [Clang] use const references for function parameters in operator== and operator!= overloads in Redeclarable.h [Clang][NFC] use const references for function parameters in operator== and operator!= overloads in Redeclarable.h Jul 2, 2024
@a-tarasyuk
Copy link
Contributor Author

@zyn0217 Thanks. I've added [NCF] to the commit/title.

@zyn0217
Copy link
Contributor

zyn0217 commented Jul 2, 2024

No problem! Do you need anyone else to help you commit it?

@a-tarasyuk
Copy link
Contributor Author

@zyn0217 Yes, I do. I don't have access to merge…

@zyn0217 zyn0217 merged commit b48623c into llvm:main Jul 2, 2024
4 of 6 checks passed
@a-tarasyuk
Copy link
Contributor Author

@zyn0217 Thanks

lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang/include/clang/AST/Redeclarable.h: 4 * Function parameter should be passed by const reference
3 participants