Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hmm, it seems exceptionally unlikely for a move assignment operator to be invoked on an object with itself as the source argument. That would require an explicit use of std::move() as in:
Value x = ...; x = std::move(x);
Rather than protecting against that and making it a no-opt, I think we would want to be informed of code that manages to do so because it is probably not intended. We could instead assert(this !=RHS), but I'm not sure that is warranted either.
I'm assuming this patch was made in response to a static analysis report. If so, I suggest we follow up with the static analysis vendor.
On second thought, and after having read https://stackoverflow.com/a/9322542/11634221, I think this change is fine. There are legitimate scenarios for which self move assignment should work in the sense that the object value is preserved or is left in a valid but unspecified state; UB should be avoided.
Hi,
it seems that this broke the AMDGPU OpenMP buildbot https://lab.llvm.org/buildbot/#/builders/193/builds/35271
Happy to help if you need more info etc.
This doesn't compile, could you fix this or revert 8ac137acefc01caf636db5f95eb0977c97def1ba ?
clang/lib/AST/APValue.cpp | ||
---|---|---|
393–399 | Ditto for the other changes |
@jplehr @michaelplatings @MitalAshok @tahonermann - sorry this one slipped through the cracks. I fixed the errors now. Thank you for your review.
Thank you for the review, @aaron.ballman and @tahonermann
Investigating the build failure...
Test failure seems unrelated to this patch's changes.
Ditto for the other changes