The following valid code snippet triggers an ICE since GCC 3.4.0:

=======================================
void foo()
{
  { static const int& i = 0; }
  { static const int& i = 0; }
}
=======================================

bug.cc:4: error: redefinition of 'int _ZGRZ3foovE1i'
bug.cc:3: error: 'int _ZGRZ3foovE1i' previously declared here
bug.cc: In function 'void foo()':
bug.cc:4: internal compiler error: in layout_decl, at stor-layout.c:305
Please submit a full bug report, [etc.]

In addition the error message before the ICE is bogus, since the code
is valid. The error message was introduced in GCC 3.1.


-- 
           Summary: [4.0/4.1/4.2 regression] ICE/rejects-valid with
                    references
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, rejects-valid, 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=28338

Reply via email to