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/include/clang/AST/Redeclarable.h: 4 * Function parameter should be passed by const reference #92755

Closed
dcb314 opened this issue May 20, 2024 · 1 comment · Fixed by #92963
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" code-quality

Comments

@dcb314
Copy link

dcb314 commented May 20, 2024

Source code is

friend bool operator==(redecl_iterator x, redecl_iterator y) {
  return x.Current == y.Current;
}
friend bool operator!=(redecl_iterator x, redecl_iterator y) {
  return x.Current != y.Current;
}

Maybe better code:

friend bool operator==( const redecl_iterator & x, const redecl_iterator & y) {
  return x.Current == y.Current;
}
friend bool operator!=( const redecl_iterator & x, const redecl_iterator & y) {
  return x.Current != y.Current;
}
@dcb314 dcb314 added clang:headers Headers provided by Clang, e.g. for intrinsics code-quality labels May 20, 2024
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang:headers Headers provided by Clang, e.g. for intrinsics labels May 20, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented May 20, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (dcb314)

Source code is
friend bool operator==(redecl_iterator x, redecl_iterator y) {
  return x.Current == y.Current;
}
friend bool operator!=(redecl_iterator x, redecl_iterator y) {
  return x.Current != y.Current;
}

Maybe better code:

friend bool operator==( const redecl_iterator & x, const redecl_iterator & y) {
  return x.Current == y.Current;
}
friend bool operator!=( const redecl_iterator & x, const redecl_iterator & y) {
  return x.Current != y.Current;
}

zyn0217 pushed a commit that referenced this issue Jul 2, 2024
…== and operator!= overloads in Redeclarable.h (#92963)

Fixes #92755
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this issue Jul 3, 2024
kbluck pushed a commit to kbluck/llvm-project that referenced this issue 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" code-quality
Projects
None yet
3 participants