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: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 15:12:37 -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 reichelt at gcc dot gnu dot org 2005-07-21 15:12 -------
The ICE is fixed now. But maybe some additional code cleanup is needed:
Giovanni, what about the following code snippet from typeck2.c?
Is the comment still valid? What about the error message, is it
still triggered in some cases?
/* Find the first named field. ANSI decided in September 1990
that only named fields count here. */
tree field = TYPE_FIELDS (type);
while (field && (!DECL_NAME (field) || TREE_CODE (field) != FIELD_DECL))
field = TREE_CHAIN (field);
if (!field)
{
error ("union %qT with no named members cannot be initialized",
type);
ce->value = error_mark_node;
}
ce->index = field;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15938