[llvm-bugs] [Bug 41784] volatile copy assignment operator for std::atomic

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 1 07:20:08 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=41784

Louis Dionne <ldionne at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ldionne at apple.com
 Fixed By Commit(s)|                            |c448ea948c28878735fefec734d
                   |                            |8326ca2e4b33a
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Louis Dionne <ldionne at apple.com> ---
Should be fixed by https://reviews.llvm.org/D90968:

commit c448ea948c28878735fefec734d8326ca2e4b33a
Author: Ruslan Arutyunyan <ruslan.arutyunyan at intel.com>
Date:   Mon Feb 1 10:12:09 2021 -0500

    [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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210201/2b736da3/attachment.html>


More information about the llvm-bugs mailing list