This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/28107] New: Incomplete type in struct added to global namespace


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]