[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 29 09:19:59 PDT 2018
rjmccall added a comment.
In https://reviews.llvm.org/D44883#1051878, @lebedev.ri wrote:
> Ok, tried llvm stage2 build, and it failed as expected, in code that intentionally does self-assignment:
Actually, this is not the sort of failure that I think should worry you. Any new warning has the ability to break -Werror builds; if I saw this failure in a build, I would totally consider it a project bug, not a false-positive.
In this case, you should just make sure there's a reasonable way to suppress the warning and then fix the code in LLVM by doing that. Explicitly casting the RHS to the right reference type should shut the compiler up.
Repository:
rC Clang
https://reviews.llvm.org/D44883
More information about the cfe-commits
mailing list