public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106290] New: A non-static data member of an anonymous union member appears in the default-member-initializer of another should be well-formed
@ 2022-07-14  1:40 xmh970252187 at gmail dot com
  2022-07-14  3:32 ` [Bug c++/106290] NSDMI and use of inner annoymous union member pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: xmh970252187 at gmail dot com @ 2022-07-14  1:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106290

            Bug ID: 106290
           Summary: A non-static data member of an anonymous union member
                    appears in the default-member-initializer of another
                    should be well-formed
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xmh970252187 at gmail dot com
  Target Milestone: ---

struct B{
    union{
      int a;
      int b = (a,10);
    };
};

For this case https://godbolt.org/z/5KnK8azEM, GCC renders an error, with a
diagnosis: 
"error: invalid use of non-static data member 'B::<unnamed union>::a'"

However, such use should be valid and does not violate any rule in the
standard. Clang accepts this example.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/106290] NSDMI and use of inner annoymous union member
  2022-07-14  1:40 [Bug c++/106290] New: A non-static data member of an anonymous union member appears in the default-member-initializer of another should be well-formed xmh970252187 at gmail dot com
@ 2022-07-14  3:32 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-14  3:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106290

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-07-14

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-14  3:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14  1:40 [Bug c++/106290] New: A non-static data member of an anonymous union member appears in the default-member-initializer of another should be well-formed xmh970252187 at gmail dot com
2022-07-14  3:32 ` [Bug c++/106290] NSDMI and use of inner annoymous union member pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).