[all-commits] [llvm/llvm-project] fa8f86: [clang-tidy] hicpp-signed-bitwise - Return locatio...

Vladimir Plyashkun via All-commits all-commits at lists.llvm.org
Wed Aug 17 11:26:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa8f8616028abbc10aa5a3ad4641e8a40ec20cc8
      https://github.com/llvm/llvm-project/commit/fa8f8616028abbc10aa5a3ad4641e8a40ec20cc8
  Author: Vladimir Plyashkun <vladimir.plyashkun at jetbrains.com>
  Date:   2022-08-17 (Wed, 17 Aug 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/hicpp/signed-bitwise-integer-literals.cpp
    M clang-tools-extra/test/clang-tidy/checkers/hicpp/signed-bitwise.cpp

  Log Message:
  -----------
  [clang-tidy] hicpp-signed-bitwise - Return location of the operand (and not of the operator beginning)

Currently, the "hicpp/signed-bitwise" check returns the beginning of the binary/unary operator as location, which sometimes confuses users in the IDE due to incorrect [[ https://youtrack.jetbrains.com/issue/CPP-12445/Clang-Tidy-highlighting-for-binary-operators-applied-to-wrong-operand | highlighting ]].
Yes, the offset from Ranges can be used for this particular check, but i suppose better solution is to return begin location of the problematic operand instead of operator.

Reviewed By: njames93

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




More information about the All-commits mailing list