This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add option to control floating point binary operators in readability-simplify-boolean-expr
Needs ReviewPublic

Authored by njames93 on Sep 24 2022, 10:28 AM.

Details

Summary

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.

Diff Detail

Event Timeline

njames93 created this revision.Sep 24 2022, 10:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 10:28 AM
njames93 requested review of this revision.Sep 24 2022, 10:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 10:28 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Eugene.Zelenko added inline comments.
clang-tools-extra/docs/ReleaseNotes.rst
155

Please enclose SafeFloatComparisons into single back-ticks.

njames93 added inline comments.Sep 25 2022, 7:33 AM
clang-tools-extra/docs/ReleaseNotes.rst
155

It would be nice if it were possible to link to the actual option documentation, but I dont think rst supports those kinds of links.

LegalizeAdulthood resigned from this revision.Mar 29 2023, 8:18 AM