This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 2 Aug 2011 15:03:16 +0000
- Subject: [Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct
- Auto-submitted: auto-generated
- References: <bug-49803-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49803
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.08.02 15:03:07
CC| |jason at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-02 15:03:07 UTC ---
Confirmed, this reduced test should not abort but does:
struct X
{
X() { __builtin_abort(); }
};
union Y
{
// N3291=11-0061 12.6.2/8 says no initialization of
// of other variant members (i.e. m_x) should
// be performed.
Y( )
: m_char1{ }
{ }
struct
{
char m_char1;
};
X m_x;
};
int main()
{
Y y;
}