[llvm-bugs] [Bug 46726] imprecise diagnostic for nested unnamed type as anonymous union member

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 15 09:49:15 PDT 2020


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Clang rejects valid code    |imprecise diagnostic for
                   |with "anonymous types       |nested unnamed type as
                   |declared in an anonymous    |anonymous union member
                   |union are an extension"     |
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Well, Clang doesn't claim that the inner union is an anonymous union, only that
it's an anonymous type, which it is. But that's really irrelevant; nested types
are not allowed at all in this context, and that's what we should be
diagnosing. So the issue is only that the diagnostic is imprecise; it is still
correct and this code is invalid. See
http://eel.is/c++draft/class.union.anon#1.sentence-3

-- 
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/20200715/cbef45c2/attachment.html>


More information about the llvm-bugs mailing list