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++/33460] New: [4.1/4.2/4.3 regression] ICE with static member in anonymous union


The following invalid testcase triggers an ICE since GCC 3.0:

===================================
struct A
{
  struct
  {
    struct { static int i; };
    void foo() { i; }
  };
};
===================================

bug.cc:5: error: 'int A::<anonymous struct>::<anonymous struct>::i' invalid; an
anonymous struct can only have non-static data members
bug.cc:4: error: an anonymous union cannot have function members
bug.cc: In member function 'void A::<anonymous struct>::foo()':
bug.cc:6: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

This is similar to PR 30302, but a little more complex.


-- 
           Summary: [4.1/4.2/4.3 regression] ICE with static member in
                    anonymous union
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, 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=33460


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