[PATCH] D128861: [clang-tidy] add cppcoreguidelines-symmetric-binary-operator

Julian Schmidt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 15:04:45 PDT 2022


5chmidti created this revision.
5chmidti added reviewers: aaron.ballman, njames93, alexfh, LegalizeAdulthood, Eugene.Zelenko.
Herald added subscribers: carlosgalvezp, shchenz, kbarton, xazax.hun, mgorny, nemanjai.
Herald added a project: All.
5chmidti requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: clang-tools-extra.

Adds a check for C++ Core Guidelines "C.161: Use non-member functions for symmetric operators"
Produces a warning on member operators that are symmetric binary operators
and generates fixes for symmetric defaulted comparison operators to be changed
to friend operator functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128861

Files:
  clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
  clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
  clang-tools-extra/clang-tidy/cppcoreguidelines/SymmetricBinaryOperatorCheck.cpp
  clang-tools-extra/clang-tidy/cppcoreguidelines/SymmetricBinaryOperatorCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-symmetric-binary-operator.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-symmetric-binary-operator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128861.441184.patch
Type: text/x-patch
Size: 30965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220629/808b91bd/attachment-0001.bin>


More information about the cfe-commits mailing list