[llvm-bugs] [Bug 24698] Unnamed struct inside union doesn't initialize entire aggregate

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 3 11:54:58 PDT 2015


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
The relevant rule is 6.2.6.1/7:

"When a value is stored in a member of an object of union type, the bytes of
the object representation that do not correspond to that member but do
correspond to other members take unspecified values."

= > The bytes corresponding to s4 contain unspecified values, because you
stored a value into the first union member.

-- 
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/20150903/cfc02dad/attachment.html>


More information about the llvm-bugs mailing list