Bug 115775

Summary: g++ 3.2.3-1 fails on "int i[8] = { [0] 0, };"
Product: [Fedora] Fedora Reporter: Maciej Żenczykowski <zenczykowski>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 3.3.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-17 13:01:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maciej Żenczykowski 2004-02-16 00:10:57 UTC
Fedora Core 1, all up2date.
gcc-c++-3.3.2-1  gcc-3.3.2-1  libgcc-3.3.2-1

Compiles as C not as C++.  Even if this isn't a legal extension (is
it?) in C++ mode it should still fail gracefully - although personally
I see no reason for it to be illegal C++.

$ cat z.c
int i[8] = {
  [0] 0,
};

$ gcc z.c
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/../../../crt1.o(.text+0x18):
In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status

$ g++ z.c
c:3: internal compiler error: in size_binop, at fold-const.c:1438
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccQTYUo9.out file, please attach
this to your bugreport

$ cat /tmp/ccQTYUo9.out 
// /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1plus -quiet
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -D_GNU_SOURCE
z.c -D__GNUG__=3 -quiet -dumpbase z.c -auxbase z -o -
# 1 "z.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "z.c"
int i[8] = {
  [0] 0,
};