[all-commits] [llvm/llvm-project] a73b87: [clang-tidy] Avoid float compare in bugprone-incor...

Piotr Zegar via All-commits all-commits at lists.llvm.org
Sat Apr 15 02:10:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a73b87b8bd47e0634d741e655ae37a22f6b82287
      https://github.com/llvm/llvm-project/commit/a73b87b8bd47e0634d741e655ae37a22f6b82287
  Author: Piotr Zegar <me at piotrzegar.pl>
  Date:   2023-04-15 (Sat, 15 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp

  Log Message:
  -----------
  [clang-tidy] Avoid float compare in bugprone-incorrect-roundings

Using APFloat to compare floating numbers instead of float/double.

Fixes: #46424

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D147906


  Commit: aa1642f6cc4ac8403b21f998a1234bea2948ac9d
      https://github.com/llvm/llvm-project/commit/aa1642f6cc4ac8403b21f998a1234bea2948ac9d
  Author: Piotr Zegar <me at piotrzegar.pl>
  Date:   2023-04-15 (Sat, 15 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/incorrect-roundings.cpp

  Log Message:
  -----------
  [clang-tidy] Add support for long double in bugprone-incorrect-roundings

Support all floating point representations for an 0.5 floating const.
Added missing tests.

Depend on D147906.

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D147908


Compare: https://github.com/llvm/llvm-project/compare/caa9d6e2f0c6...aa1642f6cc4a


More information about the All-commits mailing list