This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ICE Using const variable in c++ class
- To: gcc-bugs at gcc dot gnu dot org
- Subject: ICE Using const variable in c++ class
- From: Jeremy Sanders <jss at ast dot cam dot ac dot uk>
- Date: Wed, 12 Jul 2000 14:18:48 +0100 (BST)
Hi,
I think this is an ICE on valid code. I can't see why there's anything
wrong here.
version: gcc 2.95.2 19991024, RedHat Linux (2.2.16 kernel), i386
command line: g++ --save-temps -v -c -Wall pixelcache.cc
xpc6:~/newprogs/xspec-chandra> g++ --save-temps -v -c -Wall pixelcache.cc
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__
-Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux
-Asystem(posix) -D__EXCEPTIONS -Wall -Acpu(i386) -Amachine(i386) -Di386
-D__i386 -D__i386__ pixelcache.cc pixelcache.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/data/soft3/lheasoft_50/lheasoft/Linux_2.2_i686/include
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../i386-redhat-linux/includeEnd
of omitted list.
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/cc1plus pixelcache.ii -quiet
-dumpbase pixelcache.cc -Wall -version -o pixelcache.s
GNU C++ version 2.95.2 19991024 (release) (i386-redhat-linux) compiled by
GNU C version 2.95.2 19991024 (release).
pixelcache.cc: In method `pixelcache::pixelcache(const CFITSImage *)':
pixelcache.cc:10: Internal compiler error.
pixelcache.cc:10: Please submit a full bug report.
pixelcache.cc:10: See
<URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
I can stop the ICE by removing the const in line 4551. The code also
compiles correctly by removing pixelcache's constructor.
I /think/ this is valid code, but please correct me if I'm wrong.
Jeremy
--
Jeremy Sanders <jss@ast.cam.ac.uk> http://www-xray.ast.cam.ac.uk/~jss/
Pembroke College, Cambridge. UK Institute of Astronomy, Cambridge. UK
ii file