[llvm-bugs] [Bug 48453] Assigning to non-active trivial union member is not accepted in constexpr context

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 9 15:33:42 PST 2020


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Per http://eel.is/c++draft/class.union#general-6, an assignment can only change
the active union member if the union member has a trivial default constructor.

`Un::NestedUn` has a non-trivial default constructor, so the union member
`Un::f2` cannot be made active by simply assigning to it or one of its
subobjects.

-- 
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/20201209/2422134f/attachment-0001.html>


More information about the llvm-bugs mailing list