diff options
author | Ruslan Arutyunyan <ruslan.arutyunyan@intel.com> | 2021-02-01 10:12:09 -0500 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2021-02-01 10:14:22 -0500 |
commit | c448ea948c28878735fefec734d8326ca2e4b33a (patch) | |
tree | eb93609e38a991f656bd86074d46d5fdf79e1178 /llvm/lib/Support/APFloat.cpp | |
parent | 78c22fbce991bb5ef49db36473b71fc4386e1e85 (diff) | |
download | llvm-c448ea948c28878735fefec734d8326ca2e4b33a.zip llvm-c448ea948c28878735fefec734d8326ca2e4b33a.tar.gz llvm-c448ea948c28878735fefec734d8326ca2e4b33a.tar.bz2 |
[libc++] Fix for the Bug 41784
Add deleted volatile copy-assignment operator in the most derived atomic
to fix the Bug 41784. The root cause: there is an `operator=(T) volatile`
that has better match than the deleted copy-assignment operator of the base
class when `this` is `volatile`. The compiler sees that right operand of
the assignment operator can be converted to `T` and chooses that path
without taking into account the deleted copy-assignment operator of the
base class.
The current behavior on libstdc++ is different from what we have in libc++.
On the same test compilation fails with libstdc++. Proof: https://godbolt.org/z/nebPYd
(everything is the same except the -stdlib option).
I choose the way with explicit definition of copy-assignment for atomic
in the most derived class. But probably we can fix that by moving
`operator=(T)` overloads to the base class from both specializations.
At first glance, it shouldn't break anything.
Differential Revision: https://reviews.llvm.org/D90968
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
0 files changed, 0 insertions, 0 deletions