This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15938] ICE with anonymous unions
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 02:35:44 -0000
- Subject: [Bug c++/15938] ICE with anonymous unions
- References: <20040611122359.15938.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-07-21 02:35 -------
Subject: Re: ICE with anonymous unions
"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:
| Yes, it's because of my patch.
|
| I would like to know if we agree that the code is invalid or not. It's a bit
| hard to have a definitive answer since it is GNU C++ (uses an extension), but
| given that the C frontend accepts it, I don't see why we should reject it. In
| which case, this bug can be closed as fixed.
[I will address the validity issue as far as GNU C++ is concerned ]
Clearly, this being invalid according to ISO C++ and accepted by the C
front-end (with appropriate diagnostic), the only question that
remains is whether this is valid C++
typedef union {
struct unique_name_1 { int i; };
struct unique_name_2 { char c; };
} A;
The answer is yes. Now, the remaning thing is apply the name
restrictions as for unnamed unions.
Thanks,
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15938