Compiling the following code make an internal compiler error. However, gcc 3.2.3, 3.0.4 and 2.95.4 compile this piece of code without any error or warning. Moreover with 3.3.1 (gcc version 3.3.1 20030626 (Debian prerelease)), if 'integer' is declared when used (see integer2) compilation is also OK. ---%<--------------------- struct Parameter { virtual ~Parameter() { } }; struct IntegerParameter : public Parameter { int __intValue; operator int&() { return __intValue; } }; int main() { IntegerParameter ip; Parameter* p = &ip; int integer; integer = static_cast<int&>(dynamic_cast<IntegerParameter&>(*p)); // int integer2 = static_cast<int&>(dynamic_cast<IntegerParameter&>(*p)); }
I do not get an ICE on 3.3.1 (20030616) or the mainline (20030707), I will try a newer version of 3.3.1 to see if the ICE happens, if it does then this is a regression.
I don't get an ICE with gcc 3.3 release as well. You didn't say which flags you used for compilation, though. Would you mind posting the exact command line that triggers the error for you, as well as the output of gcc -v? Thanks Wolfgang
I cannot reproduce it on 3.3.1 (20030707). Can you provide the output which contains the ICE?
My version of g++ is > g++ -v Reading specs from /usr/lib/gcc-lib/i386-linux/3.3.1/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux Thread model: posix gcc version 3.3.1 20030626 (Debian prerelease) I do not use any flag : > g++ ice.cpp ice.cpp: In function `int main()': ice.cpp:14: internal compiler error: in build_modify_expr, at cp/typeck.c:5346 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Closing as Wolfgang nor I could reproduce this bug. Since you are using a Debian prerelease, I would report it to Debian because it might just be that a newer version removes the problem.