[PATCH] D134592: [clang-tidy] Add option to control floating point binary operators in readability-simplify-boolean-expr

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 24 10:28:18 PDT 2022


njames93 created this revision.
njames93 added reviewers: aaron.ballman, LegalizeAdulthood.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a project: All.
njames93 requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Negating a binary operator with floating point operands by negating the operator won't handle NaN comparisons correctly.
To address this an option has been added `SafeFloatComparisons`, defaults to being on, that will prevent this transformation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134592

Files:
  clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
  clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst
  clang-tools-extra/test/clang-tidy/checkers/readability/simplifiy-bool-expr-floats.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134592.462681.patch
Type: text/x-patch
Size: 14741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220924/27b5c100/attachment.bin>


More information about the cfe-commits mailing list