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++/30300] New: Bogus diagnostic for anonymous structs/classes


The compiler issues errors about anonymous unions for the following code
snippet although there's only an anonymous class:

============================
struct A
{
  class
  {
    static int i;
    int j;
  };
};
============================

bug.cc:5: error: 'int A::<anonymous class>::i' invalid; an anonymous union can
only have non-static data members
bug.cc:6: error: private member 'int A::<anonymous class>::j' in anonymous
union

It looks like the code in finish_struct_anon (cp/class.c) was copied from
build_anon_union_vars (cp/decl2.c) without adjusting the messages.


-- 
           Summary: Bogus diagnostic for anonymous structs/classes
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          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=30300


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