This piece of legal code gives an ICE with 3.4. This is a regression from 3.3: --------- cut -------- int x = y ; int y ; --------- cut -------- reduce.3797.out:1: error: `y' undeclared here (not in a function) reduce.3797.out:2: internal compiler error: tree check: expected class 'd', have 'x' (error_mark) in any_external_decl, at c-decl.c:1553 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
I cannot reproduce this on 3.4, could give the exact compiler version meaning date also. I am using 3.4 (20030526). tin:~/src/gnu/gcctest>gcc r10981.c r10981.c:2: error: `y' undeclared here (not in a function) tin:~/src/gnu/gcctest>g++ r10981.c r10981.c:2: error: `y' was not declared in this scope tin:~/src/gnu/gcctest>gcc -v Reading specs from /home/gates/pinskia/linux/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs Configured with: /home/gates/pinskia/src/gnu/gcc/src/configure --target=i686-pc-linux- gnu --enable-__cxa_atexit --prefix=/home/gates/pinskia/linux --enable-threads=posix -- enable-shared Thread model: posix gcc version 3.4 20030526 (ex perimental) tin:~/src/gnu/gcctest>
I used 20030519, but I can confirm that this is already fixerd in today's CVS.