aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-06-14 07:57:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-06-14 08:04:03 +0200
commitb5b9489b2415dc48c39d4d7d4bae6197dc499f38 (patch)
tree228bdf2531a3e69bfd1a13c79b7b134283528f46 /llvm/lib/CodeGen/MachineOperand.cpp
parent8449af41e5c735960691f711ed9500c2a80a0b11 (diff)
downloadllvm-b5b9489b2415dc48c39d4d7d4bae6197dc499f38.zip
llvm-b5b9489b2415dc48c39d4d7d4bae6197dc499f38.tar.gz
llvm-b5b9489b2415dc48c39d4d7d4bae6197dc499f38.tar.bz2
Only consider built-in compound assignment operators for -Wunused-but-set-*
At least LibreOffice has, for mainly historic reasons that would be hard to change now, a class Any with an overloaded operator >>= that semantically does not assign to the LHS but rather extracts into the (by-reference) RHS. Which thus caused false positive -Wunused-but-set-parameter and -Wunused-but-set-variable after those have been introduced recently. This change is more conservative about the assumed semantics of overloaded operators, excluding compound assignment operators but keeping plain operator = ones. At least for LibreOffice, that strikes a good balance of not producing false positives but still finding lots of true ones. (The change to the BinaryOperator case in MaybeDecrementCount is necessary because e.g. the template f4 test code in warn-unused-but-set-variables-cpp.cpp turns the += into a BinaryOperator.) Differential Revision: https://reviews.llvm.org/D103949
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions