[PATCH] D146897: [clang:diagnostics] Turning off warn_self_assignment_overloaded for user-defined compound assignments
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 4 11:17:33 PDT 2023
rsmith added inline comments.
================
Comment at: clang/lib/Sema/SemaExpr.cpp:15656
case BO_XorAssign:
- DiagnoseSelfAssignment(S, LHS, RHS, OpLoc, false);
CheckIdentityFieldAssignment(LHS, RHS, OpLoc, S);
break;
----------------
This is the same thing, but for `this->x += this->x`. I think we should also suppress those warnings for compound assignment, except when one of the operands is an implicit member access and one is an explicit member access (`this->x += x;` should still warn if the latter `x` is also interpreted as `this->x`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146897/new/
https://reviews.llvm.org/D146897
More information about the cfe-commits
mailing list