Issue 146519
Summary [clang-tidy] Remove redundant comparison operators
Labels clang-tidy
Assignees
Reporter SunBlack
    Since C++20 rewriting rules exists, so that it is e.g. not anymore necessary to define `operator!=` when `operator==` already exists.

I hope that the compilers will optimize accordingly, so that the rewrite rule is always as fast as the manual rule (as an example: If there used to be `a!=b` and `a==b` and you remove the former rule, that the compiler does not make `!(a==b)` out of it, i.e. 2 assemler instructions instead of one).

SonarLint already have a [check](https://rules.sonarsource.com/cpp/RSPEC-6186/) for this, so that you could spot what could also be adjusted.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to