[all-commits] [llvm/llvm-project] fbe4d9: [clang-tidy] fix false-negative for macros in `rea...

Julian Schmidt via All-commits all-commits at lists.llvm.org
Mon Apr 29 22:22:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fbe4d991323b026eb64cd3d0ee811854b54ca33f
      https://github.com/llvm/llvm-project/commit/fbe4d991323b026eb64cd3d0ee811854b54ca33f
  Author: Julian Schmidt <git.julian.schmidt at gmail.com>
  Date:   2024-04-30 (Tue, 30 Apr 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/MathMissingParenthesesCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp

  Log Message:
  -----------
  [clang-tidy] fix false-negative for macros in `readability-math-missing-parentheses` (#90279)

When a binary operator is the last operand of a macro, the end location
that is past the `BinaryOperator` will be inside the macro and therefore
an
invalid location to insert a `FixIt` into, which is why the check bails
when encountering such a pattern.
However, the end location is only required for the `FixIt` and the
diagnostic can still be emitted, just without an attached fix.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list