[PATCH] D131678: hicpp-signed-bitwise - Return location of the operand (and not of the operator beginning)

Vladimir Plyashkun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 07:02:04 PDT 2022


vladimir.plyashkun created this revision.
vladimir.plyashkun added reviewers: JonasToth, steveire, njames93.
vladimir.plyashkun added a project: clang-tools-extra.
Herald added a subscriber: carlosgalvezp.
Herald added a project: All.
vladimir.plyashkun requested review of this revision.
Herald added a subscriber: cfe-commits.

Hello! 
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 highlighting <https://youtrack.jetbrains.com/issue/CPP-12445/Clang-Tidy-highlighting-for-binary-operators-applied-to-wrong-operand>. 
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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131678

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131678.451837.patch
Type: text/x-patch
Size: 8371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220811/a81b8bcd/attachment-0001.bin>


More information about the cfe-commits mailing list