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++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration


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


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