This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28107] New: Incomplete type in struct added to global namespace
- 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: 20 Jun 2006 19:38:02 -0000
- Subject: [Bug c++/28107] New: Incomplete type in struct added to global namespace
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For the following invalid code snippet
==================
struct A
{
union B b;
};
struct B;
==================
the C++ frontend generates the following error message:
bug.cc:3: error: field 'b' has incomplete type
bug.cc:6: error: 'struct' tag used in naming 'union B'
While the first line is OK, the second one is not.
Apparently, union B is added to the global namespace.
IMHO it should be placed into A.
--
Summary: Incomplete type in struct added to global namespace
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28107