[Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration

reichelt at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Nov 18 12:38:00 GMT 2006


The following IMHO valid code snippet is rejected since GCC 4.0.0:

============================
struct A
{
  static int x[1];
};

void foo(int i)
{
  if (int(A::x[i])) {}
}
============================

bug.cc: In function 'void foo(int)':
bug.cc:8: error: array bound is not an integer constant


-- 
           Summary: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted
                    as variable declaration
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: 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=29886



More information about the Gcc-bugs mailing list