[Bug c++/29175] New: ICE on invalid: C++ static variable length array

ian at airs dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 21 21:35:00 GMT 2006

Compiling this invalid C++ code with current mainline:

void foo() { static int c = 2; static const char *a[][c] = { { "1", "2" } }; }

gives me:

foo.cc: In function ‘void foo()’:
foo.cc:1: internal compiler error: in tree_low_cst, at tree.c:4519
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

It should instead say something along the lines of

foo.cc:1: error: array bound is not an integer constant

           Summary: ICE on invalid: C++ static variable length array
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


More information about the Gcc-bugs mailing list